1. The GetStringChars() method returns a pointer to an array of Unicode characters. It is best to declare the pointer as const jchar* const to help forestall any attempt to modify the Java string in place. 2. Because a jchar is an unsigned integer, no REINTERPRET_CAST is required in constructing a 16-bit descriptor from it (unlike with the 8-bit case).
3. Use a TPtrC16 to point to the Unicode data (without modifying it). The TFileName (a TBuf) has its own buffer to which the cp1252 data is copied. The original Unicode version can immediately be released with a call to ReleaseStringChars() and the cp1252 version used and/or modified as wished.
4. The code will have to link with charconv.lib. This can be done with the EXTRA_LIBS flag in the Makefile.
5. To perform the reverse transcription, the ConvertToUnicodeFromNative8BitBuild() function should be used. This converts a Symbian OS cp1252 descriptor to an intermediate Unicode descriptor from which a Java string can be built with the NewString() JNI method.
6. For further details about standard JNI methods see http://java.sun.com/products/jdk/1.2/docs/guide/jni/spec/jniTOC.doc.html
7. While this approach works under ER5 (Series 5mx, netBook, Series7), it is well to be aware that the CHARCONV APIs it uses is superceded by new APIs from v6 of the Symbian OS.