Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I convert json data?
    text
    copied!<p>I've got json data. There is "cyrillic" strings in json file, like this one:</p> <pre><code>\u0418\u0432\u0430\u043D\u043E\u0432 \u0418. </code></pre> <p>When I decode json and put this data in database table I get the string </p> <pre><code>Иванов И. </code></pre> <p>On <a href="http://www.artlebedev.ru/tools/decoder/" rel="nofollow">one decoding web-site</a> I entered this string and got very good (the one I need)</p> <pre><code>Иванов И. </code></pre> <p>And also this site told me that it was converted from CP1252 to UTF-8. So I tried to convert data from json after decoding manually using</p> <pre><code>mb_convert_encoding ( $string, "UTF-8","windows-1252"); mb_convert_encoding ( $string, "UTF-8","CP1252"); </code></pre> <p>and </p> <pre><code>iconv("windows-1252","UTF-8",$string); iconv("CP1252","UTF-8",$string); </code></pre> <p>Any of this functions made the string in database table look like</p> <pre><code>Øòðýþò ÃËœ. </code></pre> <p>or</p> <pre><code>Øòðýþò Ø. </code></pre> <p>both are not decoded on above site properly. So the question is, how do I convert this string?</p> <p><strong>Upd:</strong> used this sql request:</p> <pre><code>ALTER DATABASE logenterprise CHARACTER SET utf8 </code></pre> <p>Tried after the same things that wrote above - result is the same. Also tried this just in case:</p> <pre><code>alter table mytable convert to CHARACTER SET utf8 COLLATE utf8_unicode_ci; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload