Consultor Eletrônico



Kbase P103491: get-key-value does not work with Unicode extended characters.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   4/21/2005
Status: Unverified

FACT(s) (Environment):

Windows
OpenEdge 10.x

SYMPTOM(s):

get-key-value does not work with Unicode extended characters.

Using get-key-value to read a registry key into Progress does not retrieve the correct characters.

Copying and Pasting Unicode characters from the Windows Character Map tool into a registry key, then reading the key value into a UTF-8 client Progress 4GL variable with get-key-value, does not retrieve the correct characters.

CAUSE:

This is expected behavior. Pasting characters into the registry with the Character Map tool adds a Unicode representation of the character to the registry and not the UTF-8 representation. Progress supports Unicode through UTF-8 encoding, so subsequently the Unicode characters may appear incorrect when read.

FIX:

Update the registry with the appropriate UTF-8 multi byte sequences representing the characters. Alternatively write the character value out with put-key-value to be sure of the correct value, and then read it back. For example run the following code in a UTF-8 GUI client session:

DEFINE VARIABLE c AS CHARACTER NO-UNDO.
c = CHR(128, "UTF-8", "1252"). /* Euro */

/* Write 3 byte Euro symbol to registry */
put-key-value
section 'startup'
key 'test'
value c.

/* read 3 byte Euro back from Registry */
get-key-value
section 'startup'
key 'test'
value c.
MESSAGE c c = ? skip length(c,"RAW")
VIEW-AS ALERT-BOX INFO BUTTONS OK.