Closed IllesAprod closed 3 years ago
@IllesAprod I wasn't able to reproduce it. Have you tried curl-ing to see what you get back?
curl -H "Accept-Charset: utf-8" -X GET 'https://conversations.twilio.com/v1/Conversations/CHXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Messages/IMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
-u $TWILIO_ACCOUNT_SID:$TWILIO_AUTH_TOKEN
@shwetha-manvinkurke
Thanks for your reply, I tried with curl (I had to put /Services/ISXXX... in the url but I dont think it makes any difference)
The message what i sent was (Screenshot from twilio js conversations sdk)
ááűűúúőőóóüüööíí
With curl i get:
{"body": "\u00c3\u00a1\u00c3\u00a1\u00c5\u00b1\u00c5\u00b1\u00c3\u00ba\u00c3\u00ba\u00c5\u0091\u00c5\u0091\u00c3\u00b3\u00c3\u00b3\u00c3\u00bc\u00c3\u00bc\u00c3\u00b6\u00c3\u00b6\u00c3\u00ad\u00c3\u00ad"
Which is converted (using this converter: https://r12a.github.io/app-conversion/)
ááűűúúÅÅóóüüööÃÃ
And that looks the same what i get when I try
$message = $client->conversations->v1->services('XXX')->conversations($sid)->messages($messageSid)->fetch();
var_dump($message->body);
So as I can see this is a Twilio Backend related error, can u help how to reach them with that?
Hi @shwetha-manvinkurke
We went further and we had to use $body = utf8_decode($message->body); to get good encoding (maybe it should be added to the sdk?)
Thanks for your help
Hi @IllesAprod I suggest reaching out to support and discussing this issue with them.
Issue Summary
When fetching a message with twilio-php it gives me wrong encoded characters (on client side with js sdk we get good encoding)
Steps to Reproduce
Possible workaround: With iconv we were able to minimize wrong characters, but "ő" stil not working ááűűúúőőóóüüööíí --> ááűűúú�?�?óóüüööíí Example code:
Technical details: