<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hi,<div><br></div><div>I need to load Shift-JIS encoded .dbf file but I cannot seem to find an option to set proper source encoding.</div><div>Normally, I would expect to find Shift_JIS or CP932 in Source encoding at QGIS 2.0.1 > Layer > Add Vector Layer, </div><div>but I cannot find SJIS, Shift_JIS, CP932, EUC-JP, JIS7 or anything else that remotely resembles Japanese encoding.</div><div><br></div><div>I did a bit of source code digging as well just to have a look, and found that Shift-JIS is included in src/core/qgsvectordataprovider.cpp (#423) as a compiler option,</div><div>and if that's not compiled, QTextCodec::availableCodecs() also includes Shift-JIS <a href="http://qt-project.org/doc/qt-4.8/qtextcodec.html#details">http://qt-project.org/doc/qt-4.8/qtextcodec.html#details</a> *1</div><div>I can see codecs included in QTextCodec like Iscii-Bng, Dev, Gjr… in my source encoding list, but no Shift-JIS.</div><div>So my guesses are either availableCodecs() returning an erratic list, </div><div>or something is happening to it after it has been fed through the dataprovider, but I don't know how to trace that with my limited skills.</div><div><br></div><div>I have used Homebrew and tap from dakcarto <a href="https://github.com/dakcarto/homebrew-osgeo4mac">https://github.com/dakcarto/homebrew-osgeo4mac</a> (many thanks to dakcaro for sharing this)</div><div>MacOSX 10.8.5</div><div>QGIS: 2.0.1</div><div>GDAL: 1.10.1 (brewed)</div><div><br></div><div>As alternatives, I can currently a) convert every shapefiles into UTF-8 and load them b) use Shapefile Encoding Fixer to correct encoding every time.</div><div>Also note that when "Ignore shapefile declaration" is checked, Shapefile Encoding Fixer plugin will not work (LDID/CPG) and data inside attribute table is incorrectly displayed, but when it is not checked, correct attributes are displayed by setting LDID=SJIS.</div><div><br></div><div>Does anyone have any ideas as to how to fix this issue, or have had similar experiences while using non-UTF8 encoded shapefiles?</div><div><br></div><div>*1 just to make sure, and I've got the same results from the Python console inside QGIS.</div><div><div>Python 2.7.5 (v2.7.5:ab05e7dd2788, May 13 2013, 13:18:45) </div><div>[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin</div><div>Type "help", "copyright", "credits" or "license" for more information.</div><div>>>> from PyQt4 import QtCore</div><div>>>> QtCore.QTextCodec.availableCodecs()</div><div>[PyQt4.QtCore.QByteArray('System'), PyQt4.QtCore.QByteArray('UTF-8'),</div></div><div>/*snip*/</div><div>PyQt4.QtCore.QByteArray('EUC-JP'), PyQt4.QtCore.QByteArray('ISO-2022-JP'), </div><div>PyQt4.QtCore.QByteArray('Shift_JIS'), PyQt4.QtCore.QByteArray('JIS7'), PyQt4.QtCore.QByteArray('SJIS')</div><div>/*snip*/</div><div><br></div><div>Thanks,</div><div>Akihiro</div></body></html>