Json response with \uXXXX character  

  RSS

ds5787
Active Member
Joined: 2 years  ago
Posts: 9
7 March 2018 16:17  

I need to call an API in a DMVC server from PHP Client. The controller has the attribute
[MVCProduces('application/json,''UTF-8')]
and for the special characters it returns something like this:
\u00B0 \u00E0 \u00E8 \u00F9 \u00F2 \u00C9

On Stackoverflow someone say:
"If, as I think, the software that encoded the original UTF-8 string to JSON was oblivious to the fact it was UTF-8 and blindly encoded each byte to an escaped unicode code point, then you need to convert each pair of unicode code points to an UTF-8 encoded character, and then decode it to the native PHP encoding to make it printable"
https://stackoverflow.com/questions/14523846/convert-unicode-from-json-string-with-php

I tried to change the attribute with ISO-8859-1 but it has the same behaviour. 

With a old versions of DMVC the problem there isn't.

What's wrong?


ReplyQuoteLikeReport
Daniele Teti
Trusted Member
Joined: 2 years  ago
Posts: 53
24 May 2018 10:54  

Did you solve the problem?

 

DT

Daniele Teti
CEO & CTO @ bit Time Professionals
Embarcadero MVP
Books Author


ReplyQuoteLikeReport
  
Working

Please Login or Register