Index: MutableProperty.java =================================================================== RCS file: /home/cvspublic/jakarta-poi/src/java/org/apache/poi/hpsf/MutableProperty.java,v retrieving revision 1.5 diff -u -r1.5 MutableProperty.java --- MutableProperty.java 22 Jun 2004 16:11:39 -0000 1.5 +++ MutableProperty.java 31 Aug 2004 09:13:52 -0000 @@ -108,6 +108,14 @@ { int length = 0; long variantType = getType(); + + /* Ensure that wide strings are written if the codepage is Unicode. */ + if (codepage == Constants.CP_UNICODE && variantType == Variant.VT_LPSTR) { + variantType = Variant.VT_LPWSTR; + // set the variant type as well since it is changed (?) + setType(variantType); + } + length += TypeWriter.writeUIntToStream(out, variantType); length += VariantSupport.write(out, variantType, getValue(), codepage); return length;