Recent

Author Topic: JsonConf unit: how to save Unicode string with \uNNNN ?  (Read 1559 times)

AlexTP

  • Hero Member
  • *****
  • Posts: 2386
    • UVviewsoft
JsonConf unit: how to save Unicode string with \uNNNN ?
« on: February 19, 2019, 10:01:35 pm »
JsonConf parses \uNNNN codes on read.
How to tell it to write unicode via \uNNNN?
Currently it writes Russian text as UTF8 encoded.

FPC trunk.

I need it in JSON key and value.

Code: Pascal  [Select][+][-]
  1. {
  2.   "\u1020": "\u2030"
  3. }
  4.  
« Last Edit: February 19, 2019, 10:11:36 pm by Alextp »

jamie

  • Hero Member
  • *****
  • Posts: 6090
Re: JsonConf unit: how to save Unicode string with \uNNNN ?
« Reply #1 on: February 20, 2019, 11:40:04 pm »
The other day I took values like that decoded them as HEX and placed them into a WideChar, from there
I then used a AnsiString or you can use a UTF8String to be assigned from the widechar..

 I am sure there are other ways, but it did correctly translate what I was looking at  :o
The only true wisdom is knowing you know nothing

 

TinyPortal © 2005-2018