If XPCOM component has some method with "out" parameter wstring, (for eg. void TestWString(out wstring i);) And somebody tried to call this method from Java, then extra garbage symbols will be passed to Java. For example if in native code you put "Some test string" then in Java code you may got "Some test string?w0w0.." Suggested reason: In bcJavaMarshalToolkit::UnMarshalElement "size of buffer" used to construct new jstring, but really "size of buffer" = length * sizeof(PRUnichar) + 2 So we should use length = ("size of buffer" - 2)/sizeof(PRUnichar) to construct jstring via env->NewString method.
fixed integrated into the trunc
Work now. Mark VERIFIED