aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/poi/hpsf/MutableProperty.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/java/org/apache/poi/hpsf/MutableProperty.java b/src/java/org/apache/poi/hpsf/MutableProperty.java
index 1aa603a4ab..e80644b197 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;