Closed zhangziyi123 closed 2 years ago
checkout the new version I just published though see the note in the readme about IE
On Fri, Jun 9, 2017 at 3:00 AM service notifications@github.com wrote:
There is a problem in Chinese;If the attribute value is Chinese, there will be a problem with the Chinese language
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/calvinmetcalf/shapefile-js/issues/80, or mute the thread https://github.com/notifications/unsubscribe-auth/ABE4n5DJmNLoZuR20dtouw1eTGI2j0-8ks5sCO14gaJpZM4N0-Wc .
I' m having same issue here,Chinese character is not encoded correctly and I am using Chrome. What else steps are needed to display them correctly?Thanks.
have you tried the nw version @wxia5 ?
yes,I am using the gh-page branch and still no luck. However, I find this link works for me. link It works fine for my data which is encoded in gb2312. Hope it helps a little bit. Regards.
@calvinmetcalf I think the problem is here https://github.com/calvinmetcalf/shapefile-js/blob/gh-pages/lib/index.js#L93
parseDbf takes buffer and encoding. That line is giving it buffer and undefined.
@fix in #95
I am using the latest version of this library. And parseing a shp-file
Observable.forkJoin([ Observable.fromEvent(shpReader, 'loadend').first(), Observable.fromEvent(dbfReader, 'loadend').first() ]).subscribe(res => { let geoJson = shp.combine([shp.parseShp(shpReader.result), shp.parseDbf(dbfReader.result)]) }); shpReader.readAsArrayBuffer(shpFile.shp); dbfReader.readAsArrayBuffer(shpFile.dbf);
My attributevalues contains swedish chars and i can't manage to get them in right encoding. Any tips?
shp.parseDbf(dbfReader.result)
can take as a second argument the encoding, aka the contents of the .cpg
file
I got the same problem. The shp file created by ArcGIS doesn't contain cpg, while the Chinese characters are encoded by GBK. Then I use QGIS to edit the files, it works. 使用QGIS生成的shp可以在这个插件下正常使用。
There is a problem in Chinese;If the attribute value is Chinese, there will be a problem with the Chinese language