Feature request #6059

add the ability to select character code when creating a new shape file

Added by yoichi Kayama over 10 years ago. Updated over 9 years ago.

Pull Request or Patch supplied:No Resolution:fixed
Easy fix?:No Copied to github as #:15421


When creating new shape file, we can't select character code set.
We must create all new files in the UTF-8 .
There is an inconvenience if we can not use column names only a short time when it UTF-8 Because of a limitation of the length of the column name in the Shapefile.
So I want to add the ability to select character code when creating a new shapefile.

newshape.png (26.1 KB) yoichi Kayama, 2012-07-17 01:24 PM

qgsencodingfiledialog.png (37.8 KB) Minoru Akagi, 2012-08-06 01:49 AM

fieldnameencoding.patch Magnifier (3.55 KB) Minoru Akagi, 2012-10-10 10:19 PM

fieldnameencoding_UTF8.patch Magnifier - patch file saved in UTF-8 (1.78 KB) Minoru Akagi, 2012-10-10 10:27 PM

Related issues

Related to QGIS Application - Bug report #4540: Garbled field names in newly created Shapefiles Closed 2011-11-16


#1 Updated by Minoru Akagi over 10 years ago

The encoding selectbox you wish is in the QgsEncodingFileDialog. It is displayed next to the "New Vector Layer" dialog.

As you know, the field name of DBF has some restrictions. As an example, it should be ASCII characters.

If you have to use multibyte or non-ASCII characters in the field names, you should use "Attribute aliases" ​​of QGIS. The aliases ​​are stored in both the QGIS Layer Style File(.qml) and the QGIS project file(.qgs). It works well.

#2 Updated by Paolo Cavallini over 10 years ago

  • Target version changed from Version 1.8.0 to Version 2.0.0

#3 Updated by Pirmin Kalberer about 10 years ago

  • Target version changed from Version 2.0.0 to Future Release - Nice to have

#4 Updated by Minoru Akagi about 10 years ago

Attached patch is useful for users who want to use non-ASCII characters in field names of attribute table. It modifies encoding conversion of field names in both creating new shapefile layer and adding column. It
  • Allows users to use non-ASCII characters in the field names even if selected encoding is not UTF-8.
  • Will increase the number of non-ASCII characters that users can use in the field name if users select the suitable encoding.
  • Requires that "Ignore shapefile encoding" option is checked.

#5 Updated by Minoru Akagi about 10 years ago

I re-attach a patch file saved in UTF-8.

#6 Updated by Minoru Akagi almost 10 years ago

I think no user selects ASCII-incompatible character encoding such as UTF-16 and UTF-32, to create shapefiles, because all encodings in this page are ASCII-compatible encodings.

Don't devs think it might be a good idea to implement the above and leave the decision whether to use non-ASCII characters to users?

#7 Updated by Borys Jurgiel over 9 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

Also available in: Atom PDF