Converting to UTF-8

Posted by rvkanten on 02-Apr-2010 05:10

Do we have to recompile our application after converting our databases from IS8859-1 to UTF-8?

Platform: Windows

OpenEdge: 10.1C, 10.2B

All Replies

Posted by rstanciu on 02-Apr-2010 05:41

before compile you have to transform all the code-source files (*.p,*.i,*.w) from iso to UTF-8

You can use a system tool or a simple 4GL application as:

INPUT STREAM lsIN FROM VALUE(lc_filename)
      CONVERT TARGET "utf-8" SOURCE "iso8859-1".

after this take progress client:

-cpcase basic
-cpcoll basic
-cpstream utf-8
-cpinternal utf-8
-cpterm utf-8
-charset utf-8
-cplog utf-8
-cpprint utf-8


and compile all code.

*** note that a CHUI application dosen't work on UTF-8, only GUI/Webspeed/batch applications

are supported.

Posted by rvkanten on 02-Apr-2010 05:50

Rares,

Thank you for your reply.

Is recompilation absolutely necessary?

Will our application work properly without recompilation but changing client parameters as mentioned in your post?

Posted by rstanciu on 02-Apr-2010 05:59

no

MESSAGE "çàééééééô" VIEW-AS ALERT-BOX.

compiled with iso8859-15 running on UTF-8 mode give you:

attached image .

Posted by rstanciu on 02-Apr-2010 06:23

my mistake ....

in the fact IT WORKS, you don't need to recompile ... I've tested on windows

and it works.

On linux I forget to change the Konsole encoding type

Posted by rbf on 02-Apr-2010 06:46

rvkanten wrote:

Do we have to recompile our application after converting our databases from IS8859-1 to UTF-8?

Platform: Windows

OpenEdge: 10.1C, 10.2B

Basically not.

As a matter of fact, you have to be careful when recompiling your applciation in this case.

Your database contents are now UTF-8, but your sources are probably still in 1252 format.

In your new situation this means that you want to set -cpinternal to utf-8 but you have to be careful with -cpstream.

At compile time -cpstream needs to be set to 1252 so your sources compile properly.

At run time -cpstream may be set to utf-8 if you also want utf-8 output to disk (Office 2007 for example) but that has nothing to do with your concerns above.

HTH Peter

This thread is closed