Search code examples
delphiunicodeutf-16

Accent encodings


I try to read a string containing accents in Delphi. I don t know the real encoding of he string. I suppose it is UNICODE.

My problem is with the accents.

When I read it as UNICODE, the char é is shown as e (2 chars : e and ')

same problem for è which is seen as e` (2 chars : e and `)

Why that ?

Thanks for your help.


Solution

  • If your problem is indeed the wrong composition mode, as guessed by Rudy, then WideCharToMultiByte function may help you convert the string to precomposed mode. See note "WC_COMPOSITECHECK and related flags" at the end of WideCharToMultiByte help.