Menu

#33 encoding error

v1.0 (example)
closed-works-for-me
nobody
None
5
2014-03-08
2012-05-02
马飞虎
No

hello
I come from China, English is not good I hope you can understand what I mean.
when i set gb2312 as the encodingtype, it is broken.
this bug look like bug 3442164.
DBF.java
protected void write_Field_header(Field tField) throws IOException, xBaseJException {
byte[] byter = new byte[15];

int nameLength = tField.getName().length();
int i = 0;
byte[] b;
try { b = tField.getName().toUpperCase().getBytes(encodedType);
} catch (UnsupportedEncodingException UEE) {
b = tField.getName().toUpperCase().getBytes();
}
for (int x = 0; x < b.length; x++) {
byter[x] = b[x];
}
this.file.write(byter, 0, nameLength);

for (i = 0; i < 14; i++) {
byter[i] = 0;
}
this.file.writeByte(0);
if (nameLength < 10) {
this.file.write(byter, 0, 10 - nameLength);
}
this.file.writeByte(tField.getType());

this.file.write(byter, 0, 4);

this.file.writeByte(tField.getLength());
this.file.writeByte(tField.getDecimalPositionCount());

if ((this.version == 3) || (this.version == -125)) {
byter[2] = 1;
}
this.file.write(byter, 0, 14);
}

Discussion

  • 马飞虎

    马飞虎 - 2012-05-02
    • assigned_to: nobody --> usacoder
     
  • Joe McVerry

    Joe McVerry - 2012-05-02

    do you have a fix for this bug?

     
  • Joe McVerry

    Joe McVerry - 2012-05-02
    • assigned_to: usacoder --> nobody
     
  • Joe McVerry

    Joe McVerry - 2014-03-08
    • status: open --> closed-works-for-me
    • Group: --> v1.0 (example)
     

Log in to post a comment.

MongoDB Logo MongoDB