Representing Local NLS characters in UTF8

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Representing Local NLS characters in UTF8

Post 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 :)
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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?!
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Doesn't that depend on the NLS setting of your Windows environment?
-craig

"You can never have too many knives" -- Logan Nine Fingers
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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 ...
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
roy
Participant
Posts: 2598
Joined: Wed Jul 30, 2003 2:05 am
Location: Israel

Post 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.
Roy R.
Time is money but when you don't have money time is all you can afford.

Search before posting:)

Join the DataStagers team effort at:
http://www.worldcommunitygrid.org
Image
Post Reply