Author Topic: DLL request  (Read 1311 times)

0 Members and 2 Guests are viewing this topic.

Offline MR X

  • Soldier
  • **
  • Posts: 148
  • Soldat Rulezz and must be played forever
DLL request
« on: July 23, 2007, 07:32:31 am »
I search a dll that Converts a UNICODE string to an ANSI string. with no results yet. some ideas?
Soldat Rulezz and must be played forever

Offline chrisgbk

  • Inactive Staff
  • Veteran
  • *****
  • Posts: 1739
Re: DLL request
« Reply #1 on: July 23, 2007, 11:53:25 am »
Depends on what range you are dealing with. If you can guarantee that that every character in the unicode string is an ASCII character, you can convert it by treating the unicode string as bytes, and copying every second byte.

Otherwise, you can't do it directly, as it depends on the codepage of the system you convert it on, shift-JIS encoding, etc. Windows itself offers functions for doing this, but I don't know of any third party dll that wraps around that.