Code Page Conversion

Hi Team,
All the codes written and DB for our application are against the code page, ISO8859-1. Now we are planning to convert it to UTF-8. I could get some ways and steps from PROKB for converting the DB. Do we need to write any special code or perform any other operation to make the code compatible with UTF-8 code page.

Please advise. Thanks in advance..!
 

KrisM

Member
You must make sure that all your code is double-byte enabled.

For example,
do not use
var2 = substring(var1,1,1).
but use
var2 = substring(var1,1,1,"CHARACTER").
 

Casper

ProgressTalk.com Moderator
Staff member
For example,
do not use
var2 = substring(var1,1,1).
but use
var2 = substring(var1,1,1,"CHARACTER").

If I am not mistaken then this is default. So you don't have to change your code to do this. You must specially take care of the situations where you don't want it to be character. Like the example in the i18n guide with regard to file size:
Code:
[FONT=LucidaSansTypewriter][SIZE=1][FONT=LucidaSansTypewriter][SIZE=1][LEFT]DEFINE VARIABLE iFloppySize AS INTEGER NO-UNDO INITIAL 1457664.
DEFINE VARIABLE iTotal AS INTEGER NO-UNDO.
OUTPUT TO namelist.txt.
FOR EACH Customer NO-LOCK WHILE iTotal < iFloppySize:
EXPORT Customer.Name.
/* Calculate file size in bytes by adding name length, 2 quotes, carriage
return and linefeed. */
ASSIGN iTotal = iTotal + LENGTH(Customer.Name) + 4.
END.
OUTPUT TO terminal.
DISPLAY "NAMELIST.TXT is " iTotal "bytes".
IF iTotal >= iFloppySize THEN[/LEFT]
DISPLAY "namelist.txt will not fit on 1 floppy disk."
[/SIZE][/FONT][/SIZE][/FONT]

In this case you want length to be RAW and not the default character.

(Hmm, pretty up to date example don;t you all think :))

Casper
 
Top