| 287 | |
| 288 | Problem: |
| 289 | * Trying to import a LATIN1 Shapefile into a UTF-8 table: |
| 290 | {{{ |
| 291 | Unable to convert data value to UTF-8 (iconv reports "Invalid or incomplete multibyte or wide character"). Current encoding is "UTF-8". Try "LATIN1" (Western European), or one of the values described at http://www.postgresql.org/docs/current/static/multibyte.html. |
| 292 | }}} |
| 293 | |
| 294 | Solution: |
| 295 | * Export in correct encoding |
| 296 | {{{ |
| 297 | shp2pgsql -s 4326 -W LATIN1 -I mylatin1shapefile.shp public.gis |
| 298 | }}} |
| 299 | |
| 300 | Problem: |
| 301 | * Want to store data in a LATIN1 table (although this is probably not a good idea!) |
| 302 | |
| 303 | Solution: |
| 304 | {{{ |
| 305 | # View available locales |
| 306 | locale -a |
| 307 | # Activate LATIN1 locale |
| 308 | dpkg-reconfigure locales |
| 309 | # select en_US ISO-8859-1, OK |
| 310 | # Check available |
| 311 | locale -a |
| 312 | su -c - postgres "createdb -O gis -E LATIN1 mylatin1db -T template0 --lc-collate=en_US.ISO-8859-1 --lc-ctype=en_US.ISO-8859-1" |
| 313 | }}} |