Author | Topic: SEE32 / Subject / UTF-8 ? | |
---|---|---|
AUGE_OHR | SEE32 / Subject / UTF-8 ? on Thu, 11 Sep 2008 20:10:06 +0200 hi, while german Xbase++ Forum have installed new "phpBB" Ver. 3 the "Subject" with SEE32 have change. *** snip *** Subject: =?UTF-8?B?WGJhc2UtRm9ydW06IE5ldWUgU29mdHdhcmUsIEZvcmVudHJlZmZlbiBpbSBGcsO8?= =?UTF-8?B?aGphaHIgMjAwOQ==?= From: <post@xbaseforum.de> Reply-To: <post@xbaseforum.de> Sender: <post@xbaseforum.de> MIME-Version: 1.0 Message-ID: <0643d68b1e1283141c6e7f5c7a0fd4bc@www.t....liehr.de> Date: Thu, 11 Sep 2008 17:41:15 +0200 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: PhpBB3 X-MimeOLE: phpBB3 X-phpBB-Origin: phpbb://www.xbaseforum.de *** eof *** Subject shoud be encode to : "Xbase-Forum: Neue Software, Forentreffen im Frhjahr 2009" not shure where to start ... i have search Newsgroup and did found somethings with MultiByteToWideChar and WideCharToMultiByte and some Tip to use Pablo Botella ot4xb LIB ... greetings by OHR Jimmy | |
Andreas Gehrs-Pahl | Re: SEE32 / Subject / UTF-8 ? on Fri, 12 Sep 2008 02:20:33 -0400 Jimmy, >while german Xbase++ Forum have installed new "phpBB" Ver. 3 >the "Subject" with SEE32 have change. >=?UTF-8?B?WGJhc2UtRm9ydW06IE5ldWUgU29mdHdhcmUsIEZvcmVudHJlZmZlbiBpbSBGcsO8?= >=?UTF-8?B?aGphaHIgMjAwOQ==?= This means that the Subject line was Base64 encoded, because of the "ü" in the text was represented as an UTF-8 character. To convert it back, use a routine to "decode" Base64 encoded text, like "FromBase64()" from ASINet or "XbBase64Decode()" from Xb2Net. First, you need to take both of the strings between the "?B?" and the "?=", and combine them, then decode that string, and because the "ü" is UTF-8 encoded, you need to use OT4Xb's "cUtf8ToAnsi()" function to convert the resulting string to ANSI -- or use "cUtf8ToOEM()" for OEM. If a subject line starts with "=?ISO-8859-1?" (or something similar) instead of "=?UTF-8?", you won't need the cUtf8ToAnsi() function. The character set description isn't case sensitive, so it could also be "=?utf-8?" or "=?iso-8859-2?" etc. If a subject line continues with "?Q?" instead of "?B?", you need to use "FromQP()" from ASINet (or a homegrown function) instead of FromBase64()"/"XbBase64Decode()". Because that particular Subject line is longer than 75 characters, it was encoded in two parts that you need to combine. Longer text might even be split into three or four lines. The basic format for "encoded words is this: "=?" + Character-Set + "?" + Encoding + "?" + Encoded-Text + "?=" For more details, see: RFC 2047. -- Andreas --- --- Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net 415 Gute Street or: Andreas@DDPSoftware.com Owosso, MI 48867-4410 or: Andreas@Aerospace-History.net Tel: (989) 723-9927 Web Site: http://www.Aerospace-History.net --- --- | |
AUGE_OHR | Re: SEE32 / Subject / UTF-8 ? on Fri, 12 Sep 2008 08:34:38 +0200 hi, GREAT !!! thx for your detail help ! greetings by OHR Jimmy "Andreas Gehrs-Pahl" <Andreas@DDPSoftware.com> schrieb im Newsbeitrag news:1h85bkrzz7zgr$.kn5cn72w9zvf$.dlg@40tude.net... > Jimmy, > >>while german Xbase++ Forum have installed new "phpBB" Ver. 3 >>the "Subject" with SEE32 have change. > >>=?UTF-8?B?WGJhc2UtRm9ydW06IE5ldWUgU29mdHdhcmUsIEZvcmVudHJlZmZlbiBpbSBGcsO8?= >>=?UTF-8?B?aGphaHIgMjAwOQ==?= > > This means that the Subject line was Base64 encoded, because of the "" in > the text was represented as an UTF-8 character. To convert it back, use a > routine to "decode" Base64 encoded text, like "FromBase64()" from ASINet > or "XbBase64Decode()" from Xb2Net. > > First, you need to take both of the strings between the "?B?" and the > "?=", > and combine them, then decode that string, and because the "" is UTF-8 > encoded, you need to use OT4Xb's "cUtf8ToAnsi()" function to convert the > resulting string to ANSI -- or use "cUtf8ToOEM()" for OEM. > > If a subject line starts with "=?ISO-8859-1?" (or something similar) > instead of "=?UTF-8?", you won't need the cUtf8ToAnsi() function. The > character set description isn't case sensitive, so it could also be > "=?utf-8?" or "=?iso-8859-2?" etc. If a subject line continues with > "?Q?" instead of "?B?", you need to use "FromQP()" from ASINet (or a > homegrown function) instead of FromBase64()"/"XbBase64Decode()". > > Because that particular Subject line is longer than 75 characters, it was > encoded in two parts that you need to combine. Longer text might even be > split into three or four lines. The basic format for "encoded words is > this: "=?" + Character-Set + "?" + Encoding + "?" + Encoded-Text + "?=" > For more details, see: RFC 2047. > > -- Andreas > > --- --- > Andreas Gehrs-Pahl E-Mail: GPahl@CharterMI.net > 415 Gute Street or: Andreas@DDPSoftware.com > Owosso, MI 48867-4410 or: Andreas@Aerospace-History.net > Tel: (989) 723-9927 Web Site: http://www.Aerospace-History.net > --- --- | |
Hubert Brandel | Re: SEE32 / Subject / UTF-8 ? on Tue, 16 Sep 2008 20:28:13 +0200 Hi Jimmy, >> routine to "decode" Base64 encoded text, like "FromBase64()" >> from ASINet or "XbBase64Decode()" from Xb2Net. does SEE offer the needed function or did you get a different one ? I have got a implementation in PowerBasic, build with the inline assembler. No chance to understand for me I thought I red on there homepage somthing about decode Base64. | |
Pablo Botella | Re: SEE32 / Subject / UTF-8 ? on Tue, 16 Sep 2008 00:04:18 +0200 Hi, See a running test http://news.xbwin.com/ot4xb.public/164/attachments/0/atlenc.zip Just need to add the #include "atlenc.ch" and put the atlenc.dll in your app directory local cBase64 := "QmVuYWNocmljaHRpZ3VuZyDDvGJlciBuZXVlIEFudHdvcnQg4oCUIOKAnk5ldWUg" +; "Rm9yZW5zb2Z0d2FyZeKAnA==" ? cUtf8ToOem( cBase64Decode(cBase64) ) function cBase64Decode( cSrc ) local nSrcLen := Len( cSrc ) local nDstLen := Base64DecodeGetRequiredLength(nSrcLen) local cDst := ChrR(0,nDstLen) if Base64Decode(cSrc,nSrcLen,@cDst,@nDstLen) return Left(cDst,nDstLen) end return NIL Regards, Pablo Botella |