| View previous topic :: View next topic |
| Author |
Message |
koyan Guest
|
Posted: Thu Sep 04, 2003 12:14 pm Post subject: Translating character sets from Windows to ISO 8859-7 |
|
|
I am trying to find out how I can "translate" the characterset that Windows are using to the one that is required by email standarts in order to send emails in other languages (for start in Greek). The relevant page: http://www.faqs.org/rfcs/rfc1947.html
Has anyone any idea what should I do in order to do that?
Thanks,
Konstantinos
|
|
| Back to top |
|
 |
Lars B. Dybdahl Guest
|
Posted: Thu Sep 04, 2003 3:52 pm Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
koyan wrote:
| Quote: | I am trying to find out how I can "translate" the characterset that
Windows are using to the one that is required by email standarts in order |
to send emails in other languages (for start in Greek). The relevant page:
http://www.faqs.org/rfcs/rfc1947.html
I would recommend that you use utf-8 in the e-mail - I have made a test that
shows that almost all e-mail clients can do utf-8. Only some old text-mode
ones on Unix can't.
You can convert to utf-8 using Delphi's built-in utf8encode() function.
Lars.
--
Freelance programmer
Denmark
Free GNU gettext for Delphi i18n/localization tool:
http://dybdahl.dk/dxgettext/
|
|
| Back to top |
|
 |
koyan Guest
|
Posted: Fri Sep 05, 2003 7:08 am Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
"Lars B. Dybdahl" <Lars (AT) dybdahl (DOT) dk> wrote:
| Quote: | I would recommend that you use utf-8 in the e-mail - I have made a test that
shows that almost all e-mail clients can do utf-8. Only some old text-mode
ones on Unix can't.
You can convert to utf-8 using Delphi's built-in utf8encode() function.
|
Unfortunatelly utf8encode doesn't exist in Delphi 5 :-(
Konstantinos
|
|
| Back to top |
|
 |
Bernhard Geyer Guest
|
Posted: Fri Sep 05, 2003 8:33 am Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
You can use Jedi Code Library. There exists a WideStringToUt8-Funktion
http://sourceforge.net/projects/jcl
"koyan" <kkoyan (AT) yahoo (DOT) com> schrieb im Newsbeitrag
news:3f583678$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Lars B. Dybdahl" <Lars (AT) dybdahl (DOT) dk> wrote:
I would recommend that you use utf-8 in the e-mail - I have made a test
that
shows that almost all e-mail clients can do utf-8. Only some old
text-mode
ones on Unix can't.
You can convert to utf-8 using Delphi's built-in utf8encode() function.
Unfortunatelly utf8encode doesn't exist in Delphi 5 :-(
Konstantinos
|
|
|
| Back to top |
|
 |
Ralf Junker Guest
|
Posted: Sat Sep 06, 2003 8:10 pm Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
| Quote: | I am trying to find out how I can "translate" the characterset that Windows are using to the one that is required by email standarts in order to send emails in other languages (for start in Greek). The relevant page: http://www.faqs.org/rfcs/rfc1947.html
Has anyone any idea what should I do in order to do that?
|
To convert, you should translate into WideString first and the into your
destination character set.
Our DIUnicode package can read and write over 40 character sets and encodings,
like UTF-8, the Windows and ISO families, and more.
What's special about DIUnicode? It does not use any API calls to do the
conversion, and therefore runs on all Windows versions.
Regards,
Ralf
----------
The Delphi Inspiration
http://www.zeitungsjunge.de/delphi/
|
|
| Back to top |
|
 |
Danny Heijl Guest
|
Posted: Sun Sep 07, 2003 9:16 am Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
You can use the standard Windows MultiByteToWideChar/WideCharToMultiByte API
functions with a codepage parameter of CP_UTF8 with any Delphi version.
Danny
---
"koyan" <kkoyan (AT) yahoo (DOT) com> schreef in bericht
news:3f583678$1 (AT) newsgroups (DOT) borland.com...
| Quote: |
"Lars B. Dybdahl" <Lars (AT) dybdahl (DOT) dk> wrote:
I would recommend that you use utf-8 in the e-mail - I have made a test
that
shows that almost all e-mail clients can do utf-8. Only some old
text-mode
ones on Unix can't.
You can convert to utf-8 using Delphi's built-in utf8encode() function.
Unfortunatelly utf8encode doesn't exist in Delphi 5 :-(
Konstantinos
|
|
|
| Back to top |
|
 |
Bernhard Geyer Guest
|
Posted: Sun Sep 07, 2003 3:22 pm Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
Danny Heijl wrote:
| Quote: | You can use the standard Windows MultiByteToWideChar/WideCharToMultiByte API
functions with a codepage parameter of CP_UTF8 with any Delphi version.
|
CP_UTF8 isn't available for Standard-Win95
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/unicode_17si.asp
You have to add the Microsoft Layer for Unicode to work also unter Win95
|
|
| Back to top |
|
 |
Koyan Guest
|
Posted: Mon Sep 08, 2003 11:04 am Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
Ralf Junker <http://www.zeitungsjunge.de/delphi/> wrote:
| Quote: | Our DIUnicode package can read and write over 40 character sets >and encodings,
Thanks. It looks promissing, and now I am trying to test it. |
| Quote: |
To convert, you should translate into WideString first and the >into your destination character set.
By "translate into WideString" you mean just to assign the string I get from the simple memo box in to a widestring variable? |
| Quote: |
like UTF-8, the Windows and ISO families, and more.
One more question if I am not abusing your time: |
How do I make my application know what windows encoding is being entered? I am using a simple Tmemo for entering the text.
Thanks again,
Koyan
|
|
| Back to top |
|
 |
koyan Guest
|
Posted: Mon Sep 08, 2003 12:38 pm Post subject: Re: Translating character sets from Windows to ISO 8859-7 |
|
|
"Koyan" <kkoyan (AT) yahoo (DOT) com> wrote:
| Quote: |
Ralf Junker <http://www.zeitungsjunge.de/delphi/> wrote:
Our DIUnicode package can read and write over 40 character sets >and encodings,
Thanks. It looks promissing, and now I am trying to test it.
Ok. I am still trying: |
At somepoint I must be doing something wrong because the variable "FinalWstring" gets filled always with "????????"
I am doing the following:
var
StartWstring : widestring;
middleWstring: widestring;
FinalWstring : widestring;
Reader: TDIUnicodeReader;
Writer: TDIUnicodeWriter;
begin
//initialising the 2 variables
Reader := TDIUnicodeReader.Create(nil);
Writer := TDIUnicodeWriter.Create(nil);
//filling the starting widestring with the data
//from the memo box
StartWstring := mailtext.lines.text;
reader.OnReadChar := Read_Windows_1253;
reader.AddStrW(StartWstring);
middleWstring:= reader.DataAsStrW;
Writer.OnWriteChar := Write_Iso_8859_7;
writer.WriteStrW(middleWstring);
FinalWstring := writer.DataToStrW;
end;
Thanks again,
Koyan
|
|
| Back to top |
|
 |
|