0

Which function in Delphi can i use to achieve this result ?

Let's say i have this string :

var myString = 'ç';

I want to convert this string into unicode format, so it would be converted to '\u00e7'.

Is there a function in Delphi to achieve this, and vice-versa (convert '\u00e7' to 'ç') ?

Thanks

delphirules
  • 6,443
  • 17
  • 59
  • 108
  • `Ord('ç')` is `$E7` and `Chr($E7)` is `'ç'`. So at the character level you can trivially convert between character and codepoint. Would it be enough to do this for each character in your string? – Andreas Rejbrand Apr 13 '20 at 16:50
  • 1
    Does this answer your question? [Delphi decode json/utf8 escaped text](https://stackoverflow.com/questions/9713491/delphi-decode-json-utf8-escaped-text) – whosrdaddy Apr 13 '20 at 16:57
  • 1
    And to convert to escaped string, take a look [here](https://stackoverflow.com/a/11786659/800214) – whosrdaddy Apr 13 '20 at 16:59

0 Answers0