Reply from mic-bv on Apr 25 at 11:28 AM Finally I managed it, struggling at some additional problems. However, for others to learn from my experiences and problems, I'll try to describe what I did: transfer from dataset --> into a charx-Array (1Byte/char) Fn SCMS_BIN_TO_TEXT -> convert in 2-Byte Char-Array (doesn't work with strings) copy into String (related to previous coding) do translations within string copy back into char-Array (still 2 Byte) Fn SCMS_TEXT_TO_BIN -> Convert into 1-Byte xchar copy Result (xchar) into xstring (needed in next Fn as xstring) Fn SCMS_XSTRING_TO_BINARY -> convert xstring into Result ins a Binarytab with 2-byte-char, but encoded with 2 char in each double-byte. This Table can be concatenated into a string, which can be handled over into the xml conversions. BUUUUUT: There's one more problem: If it happens (through the translations within the string), that it's an odd number of characters, then the last character in Binarytab is still in a 2-byte-character (for example, a blank, $20, would be represented as $2000). After some carryover and taking care, that the last byte of the file is also appended, I finally made it. In case somebody likes to have the (a bit chaotical) coding, personal mail me.
| | | ---------------Original Message--------------- From: Stefan Vermeulen Sent: Wednesday, April 24, 2013 3:15 AM Subject: xstring to string I need to convert a xstring to a string, something without conversion. Meaning, as an example, xstring contains 3C3F786D6C2076657273696F string should contain that value as hex, not as character-value. When assigning string = xstring the value of string would be "3C3F786D6C2076657273696F" instead of "<?xml version=" as unicode 8. All the functions etc. I found so far, would convert it to an string with 2-byte-unicode, reads as hex 003C003F0078006D006C002000760065007200730069006F Background: For reading a xml structure from a file, I open that file in binary mode and append the contents to a string. That string is given into xml conversion, telling it is utf-8. However, in Debugger that string is displayed as some chinese characters, since interpreted as utf-16 (2 Byte Unicode), but the result is fine. However, now I get some XML Infiles with some smaller problems in the file, which I like to solve. I just can't change the 1-byte-unicode-string, since it is interpreted as it was 2-byte-unicode. So I translated it into 2-byte, made the necessary changes and converted it back. Unfortunally, the result is only possible as xstring / xchar-array, which I cannot convert in the desired way into a string. | | Reply to this email to post your response. __.____._ | _.____.__ |