BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Translating character sets from Windows to ISO 8859-7

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internationalization
View previous topic :: View next topic  
Author Message
koyan
Guest





PostPosted: Thu Sep 04, 2003 12:14 pm    Post subject: Translating character sets from Windows to ISO 8859-7 Reply with 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?
Thanks,
Konstantinos
Back to top
Lars B. Dybdahl
Guest





PostPosted: Thu Sep 04, 2003 3:52 pm    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote



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





PostPosted: Fri Sep 05, 2003 7:08 am    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote




"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





PostPosted: Fri Sep 05, 2003 8:33 am    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote

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





PostPosted: Sat Sep 06, 2003 8:10 pm    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote

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





PostPosted: Sun Sep 07, 2003 9:16 am    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote

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





PostPosted: Sun Sep 07, 2003 3:22 pm    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote

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





PostPosted: Mon Sep 08, 2003 11:04 am    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote


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





PostPosted: Mon Sep 08, 2003 12:38 pm    Post subject: Re: Translating character sets from Windows to ISO 8859-7 Reply with quote


"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
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internationalization All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.