2

I have Delphi 2010.

XXX-component uses File_Path:AnsiString. A path can be written in XXX-language. If I set to use XXX-language for non-unicode programs in Windows settings then XXX-component recognize the path but if I set default Windows settings (English Windows-English for non-unicode programs) XXX-component can not recognize the path.

How to fix it?

Thank you!!!

maxfax
  • 4,281
  • 12
  • 74
  • 120
  • The difference is the codepage. Delphi uses the system's default codepage (that is why it works if you set language to XXX) but that can be changed. Do you have control over the component's code? – jpfollenius Jun 12 '11 at 15:52
  • No, I can not control. I changed all to String and it does not work. – maxfax Jun 12 '11 at 16:09
  • Switching to string is your solution. You need to be more persistent with the port away from ANSI. What is XXX-component? – David Heffernan Jun 12 '11 at 16:11

1 Answers1

2

To solve this problem you need to move away from ANSI strings and start using Unicode strings and the corresponding Unicode versions of the Windows API. At the moment you are reliant on the computer locale and that's an enormous world of pain.

Moving from AnsiString to string takes a little effort but the benefits make the effort well worthwhile.

Embrace Unicode and forget all about the bad old days!

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490