Encodings Trouble

Ruslan Zasukhin sunshine at public.kherson.ua
Mon Dec 18 11:19:05 CST 2006


On 12/06/17 8:07 PM, "Beatrix Willius" <bwillius at gmx.de> wrote:

Hi Beatrix,

> While I'm used to having encoding problems the following one has be
> stumped: Because the encoding of mail data is in the data itself and
> needs to be parsed, I first write the data into the database and do
> the parsing later. After updating to Valentina 2.4 this doesn't seem
> to work 100%. Some mails don't get parsed correctly.
> 
>   The data is written to the database:
> 
> theCursor.Field("MessageBody").SetString(currentMailFields.MessageBody)
> 
> I get the data out of the database:
> 
> dim theBody as String = theCursor.field("MessageBody").GetString
> 
> At this point I see the UTF8 question marks in a square. I do some
> parsing and then define the encoding
> 
>    'we have a Content Type
>    if instr(ContentType, "iso-8859-1") > 0 then
>      'changed from isolatin 1, which didn't work 100%
>      currentBody = defineEncoding(currentBody, Encodings.MacRomanLatin1)
>    elseif instr(ContentType, "iso-8859-2") > 0 then
>      currentBody = defineEncoding(currentBody, Encodings.IsoLatin2)
> ......
> 
> The result are fly droppings instead of nice umlauts. The same code
> works for Valentina 1. What am I doing wrong???

Well Valentina 2.x expect from you SINGLE encoding string.
You cannot put in the same string Cyrilic WIN and Cyrilic MAC.

* you can save this into BLOB

* or may be better:

    do this parsing BEFORE save into database.
    may be you need have field that keep original encoding,
    if you need that.


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list