Recent

Author Topic: UTF16ToUTF8(#$00A9) with string '00A9'?  (Read 933 times)

stem

  • Jr. Member
  • **
  • Posts: 88
UTF16ToUTF8(#$00A9) with string '00A9'?
« on: February 20, 2020, 11:07:01 pm »
Hi,

Code: Pascal  [Select][+][-]
  1. UTF16ToUTF8(#$00A9)

returns the copyright symbol. How can use this function using the string

Code: Pascal  [Select][+][-]
  1. s := '00A9'

? In other words: How can I convert this string (to its corresponding hexadecimal representation) so that I can use it with UTF16ToUTF8?

Thank you!


stem

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11383
  • FPC developer.
Re: UTF16ToUTF8(#$00A9) with string '00A9'?
« Reply #1 on: February 20, 2020, 11:10:06 pm »
Code: Pascal  [Select][+][-]
  1. var w : word;
  2.  
  3. w:=strtoint('$'+'00A9');
  4. UTF16ToUtf8(widechar(w));

stem

  • Jr. Member
  • **
  • Posts: 88
Re: UTF16ToUTF8(#$00A9) with string '00A9'?
« Reply #2 on: February 21, 2020, 09:37:38 pm »
Thank you!

 

TinyPortal © 2005-2018