Creating Cyrillic file names

Gunnar.Vogt

New Member
Hi!

I find myself in need to generate Cyrillic file names. The source is a string of HTML Hex Encoded names that I can decode. As an example I like to to set cFileName = chr(1040) + chr(1045) ...
Even so I'm in an UTF-8 session ABLs CHR function returns nothing. In my understanding ASC(CHR(1040)) should result in 1040 but ABL does not recognise the extented character set and returns-1.

According to Openedge description for CHR:
For a value greater than 255, the CHR function checks whether the value represents a valid character within the source code page.For a double-byte or Unicode source code page, it checks for a corresponding lead-byte value.

So I need to convince ABL that ih has a valid lead-byte value. But how?

Thanks for your help!
 
I'm not 100%, but try adding a client startup parameter -cpstream UTF-8 -cpinternal UTF-8.
 
1040 is the unicode code point of the Cyrillic A, it is not the utf-8 encoded value.

If you copy the following into your utf-8 session and execute it:
Code:
message asc( 'А' ) view-as alert-box.
You will see 53392 which is hex d090 - Cyrillic letters - EU Vocabularies - Publications Office of the EU

To convert a unicode code point to utf-8 you can use the OpenEdge.Core.UtilUTF8Encoder class:

Code:
message OpenEdge.Core.Util.UTF8Encoder:UnicodeToUtf8( 1040 ) = asc( 'А' ) view-as alert-box.
 
Back
Top