- I ve changed the codepage of my system to Russian as explained on this site
- PC is rebooted
- Then, I created a file in a dir with a name containing special russian character
- Then, I ve listed all files in this dir and tried to show the file with typical Delphi 7 code using:
SearchRec: TSearchRec;
FindFirst
showmessage(SearchRec.Name);
FindNext(SearchRec);
FindClose(SearchRec);
The code works well.
When I redo all 4 steps with Vietnamese instead of Russian, the filename shown with showmessage is not correct. Some ? appear instead (see the screenshot):
Please help

This is due to the way Delphi versions prior to 2009 implements their
stringtype. It is not a problem of font, but a problem of character encoding.All
stringvariables, and also all Windows API calls are performed using ANSI encoding. With ANSI, you can use only one code page at a time. In order to mix code pages (i.e. mix russian and vietnamese encodings), you’ll need to process the text and call UNICODE Windows API.Here is what occurred in your case:
So you have several workarounds:
stringwill be UNICODE, so you will be able to mix character sets;widestringfor storing your text, and call directly the windows wide APIs – that is, you can’t use the VCL units norFindFirst/FindNextas defined inSysUtils, norShowMessageas defined inDialogs.Of course, the first one is the easiest!