[Solved] Unicode escape sequence \u and fpjson lazarus / 61-Beginners ---------------------------------------------------------------------- Gerard · 2024-02-25 08:54 Hi, I am trying to pick up Pascal again by converting a Python script I wrote to display news items (coming from the Mozilla Pocket API). Having some trouble with Korean text. When having multiple Korean characters often the second character is not displayed. With the simplified example below: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i      koreanJsonData := GetJSON('{ "example": "Two unicode characters immediately after each other \uadf8\ub8f9 " }' );     Memo1.Append(koreanJsonData.findpath('example').AsString);  It should display: 그룹 (그 geu and 룹 is roup, basically the word 'group' in Korean) When not having the space a space between the \u sequences it does not display anything at all without any error.With a space it displays the characters above (with a space in between). I tried a few variations on the above, but cannot get it to display correctly. Probably I am doing something wrong, or am I encountering a bug? Best regards, Gerard ---------------------------------------------------------------------- ASerge · 2024-02-25 09:00 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i koreanJsonData := GetJSON('{ "example": "Two unicode characters immediately after each other '#$adf8#$b8f9' " }'); ---------------------------------------------------------------------- paweld · 2024-02-25 09:29 On Lazarus trunk and FPC 3.2-fixes is ok:Code: [Select]Two unicode characters immediately after each other 그룹 but if FPC 3.2.2 then:Code: [Select]Two unicode characters immediately after each other 그? ---------------------------------------------------------------------- Gerard · 2024-02-25 09:30 Thanks, that indeed seems to work with setting a string in code. I might have simplified to much though. In my complete program I use stringTFPHTTPClient.SimpleGet to get JSON data from the Mozilla Pocket web API. Instead of the string in my example the resulting JSON data from SimpleGet (stored in a string) is the argument for GetJSON(). In that input with multiple \u-characters I get output like this (second character always a question mark): 에?는 최? 국? I would expect that to be valid JSON-data (the \u escape sequence notation) that should be interpreted by fpjson, right? ---------------------------------------------------------------------- Gerard · 2024-02-25 09:32 Quote from: paweld on February 25, 2024, 10:29:17 amOn Lazarus trunk and FPC 3.2-fixes is ok:Code: [Select]Two unicode characters immediately after each other 그룹 but if FPC 3.2.2 then:Code: [Select]Two unicode characters immediately after each other 그? Ah, a bug after all, thanks! ---------------------------------------------------------------------- Gerard · 2024-02-27 20:18 Quote from: paweld on February 25, 2024, 10:29:17 amOn Lazarus trunk and FPC 3.2-fixes is ok:Code: [Select]Two unicode characters immediately after each other 그룹 but if FPC 3.2.2 then:Code: [Select]Two unicode characters immediately after each other 그? It took a while to get FPC 3.2-fixes working with Lazarus. In case somebody else encounters this thread with the same problem, try FPCUPdeluxe, saves a lot of trouble. Unicode \u escape sequences work fine now. ---------------------------------------------------------------------- bird00101011 · 2024-06-24 05:58