Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Unicode to ASCII conversion

1 view
Skip to first unread message

Christian Kaufmann

unread,
Jan 16, 2006, 3:36:26 PM1/16/06
to
Hi,

I have text as normal 8-bit characters and I know for example, that
the Windows Codepage 1250, 1252 or 1253 was used. Now I need a
function, that converts the text to unicode. Something like this:

function TextToUnicode(const AText: String; AEncoding: TEncoding):
WideString;


Then I'm looking for a function, that converts special characters to
ASCII (a-z) characters. Examples:

ä >> a
ö >> o
Unicode #261 >> a
Unicode #322 >> l

I know, that this doesn't work for all characters, but it works for
some of the Eastern Europe charactersets.

Any tips are welcome, before I start to type my own conversion table.

cu Christian

danny heijl

unread,
Jan 16, 2006, 5:46:43 PM1/16/06
to
Christian Kaufmann schreef:

> I have text as normal 8-bit characters and I know for example, that
> the Windows Codepage 1250, 1252 or 1253 was used. Now I need a
> function, that converts the text to unicode.

MultiByteToWideChar (a Windows API function) using the correct codepage
parameter does this.

Danny
---

Ralf Junker - http://www.yunqa.de/delphi/

unread,
Jan 17, 2006, 6:24:09 AM1/17/06
to
Hello Christian,

my DIConverters library supports Unicode <-> ANSI (or, more appropriately:
Unicode <-> multi-byte) conversion for more than 130 character sets, encodings
and transformation formats, including of course Windows 1250, 1252 and 1253:

http://www.yunqa.de/delphi/converters/

If you find using those functions to cumbersome, there is also my DIUnicode text
reader and writer library. It has its own build-in conversion and can also be
linked against DIConverters:

http://www.yunqa.de/delphi/unicode/

Regards,

Ralf

Christian Kaufmann <christian...@gmx.net> wrote:

---
The Delphi Inspiration
http://www.yunqa.de/delphi/

0 new messages