Bug report #11201

New Shapefile and attribute table: QGIS allows illegal characters in attribute names

Added by Andreas B over 9 years ago. Updated about 5 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Attribute table
Affected QGIS version:2.4.0 Regression?:No
Operating System:Windows 7 Easy fix?:No
Pull Request or Patch supplied:No Resolution:end of life
Crashes QGIS or corrupts data:No Copied to github as #:19512

Description

Hi all,

Some time ago I had to create a new shapefile with alot of attributes. I used comma (,), full stop (.) and slash (/) in some of the attribute names. These characters are apparently not meant to be used in attribute names (see e.g. http://support.esri.com/en/knowledgebase/techarticles/detail/23087 and http://forums.esri.com/Thread.asp?c=93&f=1149&t=279723). When I tried importing the shapefile created in QGIS in ArcMap I got an error message and the attribute table would not show up at all. I then manually removed the illegal characters and imported the shapefile again to ArcMap. Now it all went well with all attributes showing up correctly. The user should not be allowed/get a warning when using these special characters. It's interesting to see that QGIS has no problem with these characters.

Best regards,
Andreas

History

#1 Updated by Leyan Ouyang over 9 years ago

Is it really a bug in QGis if ArcGIS cannot open these files? Is there an official specification for the format of a shapefile that all implementations should respect? I did not find anything in the dBase file description I found.

#2 Updated by Andreas B over 9 years ago

Absolutely not. That was not my intention to imply. The only thing I thought may be worthwhile to look at is if you in QGIS are allowed to create attribute tables using characters which should be avoided. I do not know the Shapefile specs very well beyond the occasional googling, hence my supplied links. So if I'm incorrect, I apologize.

#3 Updated by Jürgen Fischer over 9 years ago

  • Target version changed from Version 2.6 to Future Release - High Priority

#4 Updated by Jukka Rahkonen over 9 years ago

For helping to find right documents, yes, there is an official specification about shapefile format
http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf

When is comes to .dbf, shapefile spec refers to another specification:
"For more information on the dBASE file format, visit the INPRISE Corp. Web site at
www.inprise.com." That site is dead now and I do not know where to read the most relevant info but this is good starting point http://www.digitalpreservation.gov/formats/fdd/fdd000325.shtml.

There are several versions of dbf but because the shapefile spec is from year 1998 it makes no sense to read anything about dbf versions released after that date. This message from ESRI forum lists the major restrictions http://forums.esri.com/Thread.asp?c=9&f=85&t=62319

  • limited to 10 characters
  • the field name has to start with a character
  • inside the name only characters, numbers and underscore are allowed

#5 Updated by Giovanni Manghi over 9 years ago

see also #10115

#6 Updated by Giovanni Manghi almost 7 years ago

  • Regression? set to No
  • Easy fix? set to No

#7 Updated by Giovanni Manghi about 5 years ago

  • Resolution set to end of life
  • Status changed from Open to Closed

Also available in: Atom PDF