bilaldursun1 / nettopologysuite

Automatically exported from code.google.com/p/nettopologysuite
0 stars 0 forks source link

DbaseFileWriter does not handle multibyte encodings correctly #111

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Use UTF-8 strings in attributes table, characters represented by multiple 
bytes are causing structure corruptions

What version of the product are you using? On what operating system?
NetTopologySuite.IO/NetTopologySuite.IO.GeoTools/Dbase/DbaseFileWriter.cs   (revis
ion 829)

Please provide any additional information below.
Attached patch adresses two issues:
1) the encoding that is passed in constructor is now properly used to write 
bytes into DBF
2) the length check needs to be done when reading the real bytes from value 
string and writing them to dbf. if string pad+substring calls cut the string to 
desired length, writing multibyte characters will cause structure corruptions

Original issue reported on code.google.com by morpheus...@trash-mail.com on 29 Mar 2012 at 9:33

Attachments:

GoogleCodeExporter commented 9 years ago
fixed with changeset 830.
thanks

Original comment by diegogu...@gmail.com on 29 Mar 2012 at 10:49