Page 1 of 1

Representing Local NLS characters in UTF8

Posted: Sun Jun 12, 2011 4:53 am
by roy
Hi All,
I'm trying to represent Local NLS characters in a UTF8 string.
These characters are a result of a Base64 source code.
English translates fine, but, local characters are not.

So I'm getting a source string with only A-Z,a-z,0-9,+-= as the input characters (for those not familiar with Base64) and I use some DS Basic to decode the string to it's original source string(the routine binary, in a DSX export file, is posted in the FAQ Forum).

My problem is to get the resulting numbers using the UNICHAR() function to represent local NLS characters in the UTF8 locale.

Setting the Sequential File NLS property doesn't help. I'm using notepad++ to view the file after it is written to avoid DS Client viewing issues.

I'm probably overlooking something, Any ideas?
Thanks in advance for your time :)

Posted: Mon Jun 13, 2011 9:33 am
by roy
I got to calculate the unicode number for my specific character.
But still UNICHAR(55184) (i.e.) dosen't seem to get me the desired effect.
Using notepad++ I should be able to see it correctly when I write to a sequential file using UTF-8 NLS setting , no?!

Posted: Mon Jun 13, 2011 11:10 am
by chulett
Doesn't that depend on the NLS setting of your Windows environment?

Posted: Mon Jun 13, 2011 3:04 pm
by roy
Notepad++ has a plugin utility for encoding & decoding of base64. since when I use it to decode my source string in UTF8 it shows fine I expect opening the file I built and see the desired outcome. Though my last test leads me to believe I still need to fix something in my logic... We'll see tomorrow ...

Posted: Tue Jun 14, 2011 12:55 am
by roy
Well got it working (hoping fine ths time ;))
The catch with writing t Seq File is that I had to set the NLS to unicode using the right side check box "Use UNICODE map" and unchecking the other 2 checkboxes.
Now I'm waiting for test results to confirm (hopefully) a successfull test.

P.S.
I'll update the FAQ post with a new binary.