Answered Hardcoding Unicode characters within the ABL code.

JamesBowen

19+ years progress programming and still learning.
Sorry if the title of the thread could be misleading but I was not sure how to word it.

With my ABL code I have some static/hard-coded Unicode characters which I use to output to an XML document.

I have the following code:
Code:
CHR(0xE696B0) + CHR(0xE7B4B0) + CHR(0xE6988E) + CHR(0xE9AB94)
which is interpreted as 新細明體.

Is there a more elegant way of storing the Unicode characters within the ABL code?
 
I've never tried something like this. The applications I have developed so far never needed to deal with Asian languages, so please bear with me.

You can have the UTF-8 set in your development environment ( AppBuilder or Progress Developer Studio ) and therefore the editor and the compiler should be able to handle them in a correct way. You might run into an issue where you are not able to type that characters into the editor because you might miss an according keyboard or Windows font set in your installation. Another issue might arise when the compiled code is executed with wrong -cprcodein and/or -cprcodeout settings or wrong code page used by the runtime session alltogether.

Your way all this is resolved at runtime and you just need to make sure that the code page of the session is defined correctly. Therefore I would go your way.

Heavy Regards, RealHeavyDude.
 
Thanks RHD.

I was hoping there was a developer's sneaky-sneaky tick for having Unicode character within the ABL. May be I should raise a new Feature Request to be able to escape Unicode characters.

For example:

Code:
DEF VAR SomeString AS CHAR.

SomeString = "~uE696B0u".

This might be useful for some of Progress's international customers.

You can have the UTF-8 set in your development environment ( AppBuilder or Progress Developer Studio ) and therefore the editor and the compiler should be able to handle them in a correct way.
I thought the same however Unicode characters are just displayed as "?", weird. I do have both -cpstream & -cpinternal set as "UTF-8".
 
When data is display a font is used. This is independent from the code page setting you are using - this means that you are able to process the UTF-8 characters in a correct way. That does not necessarily mean that the font you are using to display does support all UTF-8 characters too. I think the standard fonts that are available on a standard English installation of Windows are pretty limited in that regard. From what I know you would need to install a font that supports that characters and use it from the ABL.

Heavy Regards, RealHeavyDude.
 
Back
Top