Products | Versions |
---|---|
TIBCO Rendezvous | - |
Not Applicable | - |
Resolution:
In TIBCO Rendezvous, the C and C++ libraries do not do any character set translation. So, if you are using C or C++ APIs, what you send is what you get. i.e, no changes are necessary. However, Java uses Unicode as its native character format and hence requires the use of TibrvMsg.setStringEncoding() method to decide on how to translate to/from the wire format.
TIBCO Rendezvous supports packed Unicode in string types (UTF-8). Java programs represent all the strings in the Unicode 2-byte character set. Java must do some character set translation, since it uses Unicode as its native character format.
When two programs exchange messages within the same locale, the translation is correct. However, when a message sender and receiver use different character encodings, the receiving program must retranslate between encodings as needed.
The default translation depends on the locale where Java is running. That is, the locale determines the value of the Java system property "file.encoding", which in turn determines the translation scheme. When this property is inaccessible, the default encoding is 8859-1 (Latin-1). Programs can override this system property by using the method TibrvMsg.setStringEncoding(), which sets the character encoding for converting between Java Unicode strings and wire format strings.
More detailed information can be found in the section "Strings and Character Encodings" in Chapter 4 of the TIBCO Rendezvous Java Reference manual.
In addition, there are 2 Java sample programs included since the TIBCO Rendezvous 7.0 release that you may find useful: UnicodeListen.java and UnicodeSend.java located in the <tibrv>/src/examples/java directory.
UnicodeListen.java is a sample that has an optional GUI to show the foreign language characters. By default, the GUI part code is commented out.
Follow the instructions in the program to uncomment the code for the GUI and ignore the part about installing Chinese font (the font is not needed here to show the euro sign).
After compiling both programs, run the following to test:
java UnicodeListen
java UnicodeSend -message "\u20AC300"
(\u20AC is the Unicode for the euro sign)