0

I have a dxf format file named test.dxf which has some Chinese characters inside. I tried to transform it to GeoJSON file using ogr2ogr -f GeoJSON test.geojson test.dxf and returned GeoJSON showing unrecognizable characters like this:

comp:甯岀背绉戯紙鍖椾含锛夊尰鑽鎶€鏈夐檺鍏徃"

I also tried with ogr2ogr -f GeoJSON test.geojson test.dxf ENCODING='UTF-8' but it doesn't work out.

How can I get the result correctly?

Related reference:

Converting shapefile from Shift_JIS to UTF-8 when the usual methods fail

  • Do you mean that those characters are not using a correct Chinese character set? – user30184 Apr 8 at 6:10
  • No, the output of transformed Chinese characters are unrecognizable messy characters. I think maybe need to set encoding configure to ogr2ogr. – ahbon Apr 8 at 8:00
  • Have you read gdal.org/drv_dxf.html and what it says about character encoding? – user30184 Apr 8 at 8:03
  • Yes, I just read it, please give me some advices. I have read a question's answer which says I may re-save test.dxf file with encoding utf-8 using qgis, but I hope to use command like ogr2ogr -f GeoJSON test.geojson test.dxf ENCODING='UTF-8' to transform, i'm not sure if it's possible. – ahbon Apr 8 at 11:44
  • gdal.org/ogr2ogr.html – ahbon Apr 8 at 12:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.