Hi everybody,
I am currently trying to process a UTF-16 text file with Progress 9.1E.
At first I thought this would be easy, just
but then I found that UTF-16 is only supported starting with OpenEdge. Unfortunately the particular customer is running Progress 9.1E (and no, an upgrade is not an option at the moment - maybe in one or two years).
(cpinternal is 1252 if that matters.)
I tried to open the stream with UCS2 instead, but only the first three bytes (BOM and first character) are read, the following zero byte seems to terminate the input. A second import statement does not read anything.
I also tried to create a convmap.cp for Progress 9.1E using the prolang source files from OpenEdge but 9.1E seems to lack the necessary support.
Now I am trying to read the file manually, ie. using
and a memptr variable. This seems to succeed in reading the file, but I am still having trouble converting it. I would like to try codepage-convert from UCS2 to 1252, but codepage-convert only works on characters, and when I convert the memptr variable to a character variable it is again terminated by the zero byte.
My next idea is to use the Win32 API (WideCharToMultiByte looks promising) although I am not that familiar with it and it seems to be an overkill.
Any good suggestions on what I might try? I don't really want to implement a UTF-16 parser in 4GL.
Regards,
André
I am currently trying to process a UTF-16 text file with Progress 9.1E.
At first I thought this would be easy, just
Code:
input stream ImStream from ... convert source 'utf-16':U
(cpinternal is 1252 if that matters.)
I tried to open the stream with UCS2 instead, but only the first three bytes (BOM and first character) are read, the following zero byte seems to terminate the input. A second import statement does not read anything.
I also tried to create a convmap.cp for Progress 9.1E using the prolang source files from OpenEdge but 9.1E seems to lack the necessary support.
Now I am trying to read the file manually, ie. using
Code:
input stream ImStream from ... binary.
My next idea is to use the Win32 API (WideCharToMultiByte looks promising) although I am not that familiar with it and it seems to be an overkill.
Any good suggestions on what I might try? I don't really want to implement a UTF-16 parser in 4GL.
Regards,
André