[Progress Communities] [Progress OpenEdge ABL] Forum Post: RE: CODEPAGE question

Status
Not open for further replies.
S

slacroixak

Guest
To what I understand, a LONGCHAR variable is "Code-Page aware". Once you have see its code-page with the FIX-CODEPAGE Statement, you should no longer play with the CODE-PAGE() function. It should handle the conversions for you when you assign it to something by taking into account the source and target code-pages. At least, this is what I would expect. Said differently, when you do: myTekst = "Some constant". or myTekst = aSimpleCharVar. -> the ABL is aware of the code page of "Some constant" or aSimpleCharVar, aka SESSION:CPINTERNAL So the implicit ASSIGN statement should convert it automatically to the codepage of myTekst. Similarly, if you to myTekst = myUTF. -> the ABL should convert the content of myUTF from its encoding to the encoding of myTekst. If you do something like myUTF = codepage-convert('Ä','UTF-8',session:cpinternal). then you may somehow wrongly apply twice the conversion transformation and not obtain what you want BTW, I you look at the OpenEdge.Core.String new type, you will see it actually encapsulates a LONGCHAR variable and exposes an Encoding property, probably to use the FIX-CODEPAGE() Statement. I'd be pleased to be corrected by a PSC person if I'm wrong Hope it Helps.

Continue reading...
 
Status
Not open for further replies.
Top