From 740965126bec2e76677ec9fe249b6577337b5c10 Mon Sep 17 00:00:00 2001 From: Rainer Klute Date: Tue, 31 Aug 2004 20:42:12 +0000 Subject: [PATCH] - Bug 30954 fixed. git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353593 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/poi/hpsf/MutableProperty.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/java/org/apache/poi/hpsf/MutableProperty.java b/src/java/org/apache/poi/hpsf/MutableProperty.java index 1aa603a4a..e80644b19 100644 --- a/src/java/org/apache/poi/hpsf/MutableProperty.java +++ b/src/java/org/apache/poi/hpsf/MutableProperty.java @@ -108,6 +108,11 @@ public class MutableProperty extends Property { 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; + length += TypeWriter.writeUIntToStream(out, variantType); length += VariantSupport.write(out, variantType, getValue(), codepage); return length;