If some const *char string contains UTF chars, and creating a Rexx
string of it, then it seems that the UTF chars get changed to question
marks, rather than letting them untouched.

Consider the following test string, which contains non-English
characters, in this case German umlauts:

    [a-ä-o-ö-u-ü-A-Ä-O-Ö-U-Ü-sz-ß]
      

If defining the above string in a Java program (UTF charset) and
fetching it via JNI in C++ using the JNI-function GetStringUTFChars,
will replace the German umlauts with two chars and display them like, if
using fprintf(stdout, "%s"):

    [a-├ñ-o-├Â-u-├╝-A-├ä-O-├û-U-├£-sz-├ƒ]

    where:
        ä (umlaut a) is actual the sequence of the two chars "0xffffffc3" 
followed by "0xffffffa4"
        ├ (umlaut u) is actual the sequence of the two chars "0xffffffc3" 
followed by "0xffffffb6"
        ... 
    etc.

Using the ooRexx CString(str) function to create a Rexx string of such
strings yields a string that displays two consecutive question marks
(??) for each such umlaut. It seems that the conversion destroys the
embedded UTF chars. I would have expected that CString(str) would leave
those chars untouched (such that one could feed such chars back to Java
such that conversion to UTF would yield the original string on the Java
side).

Before filing a bug, I just wanted to make sure that this is not
behaving as designed.

---

As non-English characters are extremely important outside of English
speaking countries (the majority of the population in the world!), I
would request to tackle this area for a new version of ooRexx, such that
problems like these can be solved reliably once and forever.

This very same problem is also present in all XML files (and their
processing with tools, especially seeing the native ooRexx support for
this which is buing developed in the incubator) that are not restricted
to English-only characters.

Also, this problem is present wherever Rexx interfaces with
non-8-Bit-charsets, which by now is practically every operating system.

---rony

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to