Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Unicode header FileWrite (..,"~hFF~hFE" end up as 79 A9 for Korean????

Status
Not open for further replies.

2Fuzzy4U

Programmer
Dec 2, 2002
26
0
0
NL
Hi,

In my application I'm writing stuff to a file.
I start with writting a Unicode header with FileWrite (il_fileHandle, "~hFF~hFE" ) before writting anything else to the file.

Now we found that if we change the language to for example Hungarian or Korean the characters FF and FE end up in the file as different characters. (for Korean: 79 A9).

How can I get the unicode header in the file when these languages are selected?

Short overview:
FileOpen (aFile, StreamMode!, Write!, LockWrite!, Append!)

lblb_text = Blob ( as_text ,EncodingUTF16LE!)

FileWrite (il_fileHandle, "~hFF~hFE" ) //Unicode header
FileWrite (il_fileHandle, lblb_text)

FileClose (il_fileHandle)

Thanks
Coretta, NL
 
Sorry I forgot... I'm using Powerbuilder 10...
 
We've solved it with a workaround. It realy internaly that the characters are messed up, so we'll have a C function override the first two bytes.. Problem solved.. (Not quit how I would have liked to.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top