0

I have purchased Delphi XE7 recently and begin to code with it. My Windows language is English. I don't know why Delphi shows the form caption in Chinese. Also, when I read the device string of a FTDI USB interface device (see ftdichip.com), the string is read in Chinese by the Delphi program and does not match with the string displayed in English by Windows. I would like to know how to make Delphi XE7 read and display strings in English only.

My program uses the unit D2XX.pas from FTDI. It is here: [http://www.ftdichip.com/Support/SoftwareExamples/CodeExamples/Delphi/D2XXUnit.zip]

The code has to read the FTDI USB device serial number to the variable FT_Device_String : String; The unit D2XX works well under Windows XP+Delphi 5. The executable still works under Windows 10. However, when I compile my program with Delphi XE7 under Windows 7 or 10, The FT_Device_String shows all Chinese characters.

I have tried many string types in Delphi such as UnicodeString, AnsiString, WideString, etc but have got no better result. I have limited knowledge of Delphi, so your help is precious.

Thank you for your help.

Plafont
  • 1
  • 1
  • 2
    Looks like you need to read about Unicode and strings in general, [here](http://stackoverflow.com/a/1400413/800214) is a nice post to get you started. – whosrdaddy Feb 14 '17 at 20:37
  • "*I don't know why Delphi shows the form caption in Chinese*" - because you are giving it a malformed string. For instance, if you store ANSI bytes into a `UnicodeString` variable and then assign that to the `Caption`. Everything in the RTL/VCL/FMX uses UTF-16 in D2009 and later. "*when I read the device string of a FTDI USB interface device, the string is read in Chinese*" - you are likely using the wrong string type to receive the device data. If you want more help, please [edit your question](http://stackoverflow.com/posts/42235676/edit) to show your actual code. – Remy Lebeau Feb 14 '17 at 23:55

0 Answers0