Alaska Software Inc. - WAA & UTF-8 encoding - Experiences anyone?
Username: Password:
AuthorTopic: WAA & UTF-8 encoding - Experiences anyone?
Thomas BraunWAA & UTF-8 encoding - Experiences anyone?
on Tue, 19 Jun 2012 13:37:30 +0200
Hi,

currrently I'm using iso-8859-1 as the codepage for all my WAA pages.

Since the browser sends HTML entities like ę (ę) or ł (ł) for any
characters that are outside of this charset, I created a special function
that maps those characters back into the target charset:

ę -> e
ł -> l

Apparently, this is neither a nice nor a very clever solution.

Because of a customer project I'm currently looking into the possibility to
switch everything to UTF-8 encoding to get rid of those problems - I
suspect this will give me additional headaches 

I have isolated the following points as potential problems:

- Exporting data to DBF files

I'm currently using DBFDBE type files to export data to Excel - which works
quite nicely. 

The problem is that the Excel DBF import filter does not correctly
understand UTF-8 encoded content in DBF files.

I'm planning to use the function cUtf8ToAnsi() from the ot4xb library as a
workaround.

- Conversion of existing data

I have a lot of DBF files that need to be converted to UTF-8 encoding - I
will use cAnsi2Utf8() from ot4xb to get this done 
(BTW, thank you Pablo for this marvellous work)

Can you think of any more points or pitfalls to be aware of?

regards
Thomas
Pablo Botella NavarroRe: WAA & UTF-8 encoding - Experiences anyone?
on Tue, 19 Jun 2012 14:58:02 +0200
Hi,
Only 1 tip to use ot4xb under WAA ( 1.9.355 )
Recompile xppsys.dll adding small prg like this

#include "ot4xb.ch"
init proc MyInitProc
ot4xb()  or any other function inside ot4xb.dll
return

and put this xppsys.dll and ot4xb.dll into the waa1srv.exe folder

This will made the exe to use the ot4xb import library avoiding troubles when unload a package.
Probably not required if only used character conversion functions, but some classes inside ot4xb ussing TLSs and still was not found time ( and also not needed on my projects) to make ot4xb.dll dynamically unloadable

If ussing 1.9.331 ( that not using xppsys.dll) maybe simpler to steal the function from the source code and compile it 

Regards,
Pablo
Thomas BraunRe: WAA & UTF-8 encoding - Experiences anyone?
on Tue, 19 Jun 2012 16:42:29 +0200
Pablo Botella Navarro wrote:

> Hi,
> Only 1 tip to use ot4xb under WAA ( 1.9.355 )
> Recompile xppsys.dll adding small prg like this

Thanks - I'm currently still using 1.8x 

But it seems as if I got mayor problems because of List&Label seems not to
be able to display/print UTF-8 encoded strings properly.

I will be getting in contact with Combit tomorrow to see what can be done
to solve this.

Thomas
Thomas BraunRe: WAA & UTF-8 encoding - Experiences anyone?
on Thu, 28 Jun 2012 13:52:56 +0200
Thomas Braun wrote:

> But it seems as if I got mayor problems because of List&Label seems not to
> be able to display/print UTF-8 encoded strings properly.
> 
> I will be getting in contact with Combit tomorrow to see what can be done
> to solve this.

Found out that List & Label supports Unicode without problems, you just
have to call

LlSetOption(hJob, LL_OPTION_CODEPAGE, CP_UTF8)

before printing, where CP_UTF8 is a define from Microsoft:

#define CP_UTF8 65001