how to send special characters data as it is: MAU`A` in XQUERY or in OSB - osb

I am invoking CRM REST API where I have to send data with special characters. currently, it is eliminating special chars and sending to target service.My processing instructor is UTF-8.
"customFields" :
{
"CO":{
"brk_cnpj" : "50.132.588/0001-05",
"brk_inmobiliaria" : false,
"brk_rua" : "MAUA"
}
I want to send data in same format: "brk_rua" : "MAUA"

If I understand correctly, you are trying to send the character ' for example. Have you tried encoding it?
https://www.werockyourweb.com/url-escape-characters/

Related

how to extract dkim value of Authentication-Results field from message header using java mail

I want to extract dkim value of Authentication-Results field from email header.
I tried with below code and below is the response of code for reference.
code:
String Auth[] =messages[(int) i].getHeader("Authentication-Results");
System.out.println("Authentication-Results : " +
Arrays.toString(Auth) );
output:
Authentication-Results:mta4458.mail.bf1.yahoo.com from=xyz.com;
domainkeys=neutral (no sig); from=xyz-com.20150623.gappssmtp.com;
dkim=pass (ok)
I Want the following output:
dkim=pass
You need to parse the string. It doesn't seem to use the standard MIME format that other headers use so you'll need to write your own parser. The syntax is specified by RFC 5451.

ESP8266 Arduino request content encoding

I'm trying to send JSON to an Arduino module with a ESP8266. I have a simple web server, which waiting for JSON with SSID and password where device must connect.
ESP8266WebServer server(80);
server.on("/config", HTTP_POST, configHandle);
server.begin();
void handleConfig() {
String payload = server.arg("plain");
//convert JSON to char[]
//parse using jsmn lib
}
What if password contains non ASCII characters? How can I handle request content to put this arguments to method:
WiFi.begin(ssid, pass);
Edit:
Example: If I send JSON like:
{"pass": "test+test"}
Then, when I print this payload I don't get a + sign (but this is ASCII sign)
Request (wireshark):
Char array payload from board:
The ESP8266WebServer library is decoding + into a space character.
You need to URL encode the JSON string, before sending it.
In vanilla JavaScript you need to use encodeURIComponent.
Don't use encodeURI, because it doesn't encode +.
Whatever you use, make sure the + character is encoded into %2b.
This will also save you from potential problems, involving ?, & and = inside your JSON.

CakePHP Email Transport Encoding

I've created a custom transport for CakeEmail (to allow me to use Mandrill to send email). However, whenever I access the content of the message (which is cake email template driven), it doesn't encode the characters correctly (it changes 'é' to 'é', etc). If I use CakeEmail and bypass the transport, it displays the characters correctly in the email. I've narrowed this down to $email->message('html') in the transport code. If I output $email->message('html'), the characters are already incorrect.
App::uses('AbstractTransport', 'Network/Email');
App::uses('HttpSocket', 'Network/Http');
class MandrillTransport extends AbstractTransport {
public function send(CakeEmail $email) {
debug($email->message('html'));exit;
}
}
Thoughts?
You most probably have an encoding mismatch somewhere, if for example your App.encoding doesn't match your CakeEmail::$charset, CakeEmail would try to convert the content from App.encoding to CakeEmail::$charset.
https://github.com/cakephp/.../2.6.2/lib/Cake/Network/Email/CakeEmail.php#L1338
If for example the former were iso-8859-1, and the latter utf-8, just like the content, you would end up with the result you are showing here.
// outputs é when displayed as utf-8/unicode
echo mb_convert_encoding('é', 'utf-8', 'iso-8859-1');
You'll have to do some further debugging to trace down where exactly things are going wrong.

Getting more data from messages.get in C#

I'm having trouble getting more than just the snippet for text data for the message I am trying to retrieve using the Gmail API. Here is the piece of test code I am working with:
public string GetMail()
{
GmailService service = (GmailService)HttpContext.Current.Session["service"];
Message messageFeed = service.Users.Messages.List("me").Execute().Messages.First();
UsersResource.MessagesResource.GetRequest getReq = new UsersResource.MessagesResource.GetRequest(service, "me", messageFeed.Id);
getReq.Format = UsersResource.MessagesResource.GetRequest.FormatEnum.Full;
Message message = getReq.Execute();
return message.Raw;
}
For some reason, when I call message.Raw, it is returning null. I am able to retrieve other properties as what the format=minimal setting would based off of the API playground example I was playing with.
However in my code, I am setting the format enum to "full", yet I am still unable to retrieve the full data of the message.
Am I completely missing something here?
Seems like you're mixing up formats and response types. If you want the raw message as a string in Message.raw then you need to set:
getReq.Format = UsersResource.MessagesResource.GetRequest.FormatEnum.Raw;
If you want the parsed message back (in the "payload" field) then you can use getReq.Format of Full like you have.
Acceptable values are:
"full": Returns the parsed email message content in the payload field and the raw field is not used. (default)
"minimal": Only returns email message metadata such as identifiers and labels, it does not return the email headers, body, or payload.
"raw": Returns the entire email message content in the raw field as a string and the payload field is not used. This includes the identifiers, labels, metadata, MIME structure, and small body parts (typically less than 2KB).
from: https://developers.google.com/gmail/api/v1/reference/users/messages/get

Regarding character decoding and mime decoding

I have developed a program in java which fetches subject, sender, from and datetime of email information from an email account. I have done that using html parser and httpclient. I have two problems.
When I parse a subject string of the email I get some wiered character sometimes. for e.g. if subject is "Hi Mr. müller", I receive subject string as "Hi Mr. müller". As you can see it's not giving ü character properly. Any idea which encoding is this ? Is it UTF-8 ? How do I decode it to get the original string ?
I have also received email information like subject, sender, receiver, datetime etc. from yahoo account with pop3. In that I have noticed when the sender email id contains ü or ue (for e.g. reva.müller#gmx.de), it encodes it like ('=?iso-8859-1?Q?=22Reva_M=FCller=22?= '). Any idea about which encoding is this ? Is it mime encoding ? How do I decode it in java to get correct sender string ?
I would really appreciate any help.....
You need to read the RFC: http://www.ietf.org/rfc/rfc2045.txt. It will tell you how to interpret those = signs.
See "6.7. Quoted-Printable Content-Transfer-Encoding".
Also look for a Content-Type header to clue you in on the encoding.

Resources