Bug fixed in writing Unicode strings.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@353328 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
2245df361f
commit
1a25977197
@ -348,7 +348,7 @@ public class VariantSupport extends Variant
|
|||||||
case Variant.VT_LPWSTR:
|
case Variant.VT_LPWSTR:
|
||||||
{
|
{
|
||||||
final int nrOfChars = ((String) value).length() + 1;
|
final int nrOfChars = ((String) value).length() + 1;
|
||||||
TypeWriter.writeUIntToStream(out, nrOfChars);
|
length += TypeWriter.writeUIntToStream(out, nrOfChars);
|
||||||
char[] s = Util.pad4((String) value);
|
char[] s = Util.pad4((String) value);
|
||||||
for (int i = 0; i < s.length; i++)
|
for (int i = 0; i < s.length; i++)
|
||||||
{
|
{
|
||||||
@ -358,8 +358,8 @@ public class VariantSupport extends Variant
|
|||||||
final byte lowb = (byte) low;
|
final byte lowb = (byte) low;
|
||||||
out.write(lowb);
|
out.write(lowb);
|
||||||
out.write(highb);
|
out.write(highb);
|
||||||
|
length += 2;
|
||||||
}
|
}
|
||||||
length = nrOfChars * 2;
|
|
||||||
out.write(0x00);
|
out.write(0x00);
|
||||||
out.write(0x00);
|
out.write(0x00);
|
||||||
length += 2;
|
length += 2;
|
||||||
@ -386,8 +386,7 @@ public class VariantSupport extends Variant
|
|||||||
}
|
}
|
||||||
case Variant.VT_I4:
|
case Variant.VT_I4:
|
||||||
{
|
{
|
||||||
TypeWriter.writeToStream(out, ((Long) value).intValue());
|
length += TypeWriter.writeToStream(out, ((Long) value).intValue());
|
||||||
length = LittleEndianConsts.INT_SIZE;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case Variant.VT_FILETIME:
|
case Variant.VT_FILETIME:
|
||||||
|
Loading…
Reference in New Issue
Block a user