<changes>
<release version="3.5-beta7" date="2009-??-??">
+ <action dev="POI-DEVELOPERS" type="fix">47384 - Fixed ExternalNameRecord to handle unicode names</action>
<action dev="POI-DEVELOPERS" type="fix">47372 - Fixed locale-sensitive unit tests to pass when running on non-US locale</action>
</release>
<release version="3.5-beta6" date="2009-06-22">
field_1_option_flag = in.readShort();
field_2_index = in.readShort();
field_3_not_used = in.readShort();
- short nameLength = in.readShort();
- field_4_name = in.readCompressedUnicode(nameLength);
+ int nameLength = in.readUByte();
+ int multibyteFlag = in.readUByte();
+ if (multibyteFlag == 0) {
+ field_4_name = in.readCompressedUnicode(nameLength);
+ } else {
+ field_4_name = in.readUnicodeLEString(nameLength);
+ }
if(!hasFormula()) {
if (!isStdDocumentNameIdentifier() && !isOLELink() && isAutomaticLink()) {
// both need to be incremented
TestcaseRecordInputStream.confirmRecordEncoding(0x0023, dataDDE, enr.serialize());
}
+
+ public void testUnicodeName_bug47384() {
+ // 0x13A0
+ byte[] dataUN = HexRead.readFromString(
+ "23 00 22 00" +
+ "00 00 00 00 00 00 " +
+ "0C 01 " +
+ "59 01 61 00 7A 00 65 00 6E 00 ED 00 5F 00 42 00 69 00 6C 00 6C 00 61 00" +
+ "00 00");
+
+ RecordInputStream in = TestcaseRecordInputStream.create(dataUN);
+ ExternalNameRecord enr;
+ try {
+ enr = new ExternalNameRecord(in);
+ } catch (RecordFormatException e) {
+ // actual msg reported in bugzilla 47229 is different
+ // because that seems to be using a version from before svn r646666
+ if (e.getMessage().startsWith("Expected to find a ContinueRecord in order to read remaining 242 of 268 chars")) {
+ throw new AssertionFailedError("Identified bug 47384 - failed to read ENR with unicode name");
+ }
+ throw e;
+ }
+ assertEquals("\u0159azen\u00ED_Billa", enr.getText());
+ }
}