shapefile 编码错误问题解决 Wrong codepage of shapefile Warning 1: One or several characters couldn't be converted correctly from UTF-8 to ISO-8859-1.
linux下运行,因为大部分shapefile 文件,在使用时都没有指定字符集,所以qgis只能从环境变量中获取设置环境变量中获取SHAPE_ENCODING。
目前唯一的解决办法就是设置环境变量
$ SHAPE_ENCODING=UTF-8
$ export SHAPE_ENCODING
$ qgis
I insist that this is a QGIS issue.
GDAL 1.9.0 (and newer) is trying to interpret the encoding setting from the shape file itself. When creating a new shape file “ENCODING” should be passed as an attribute, which, obviously, is not done.
Calling qgis from terminal allows two track down an warning messages. Saving non-Latin characters in a shape files generates following warning message: “Warning 1: One or several characters couldn't be converted correctly from UTF-8 to ISO-8859-1.
This warning will not be emitted anymore”.
On the other hand, most of the shape files used by users are without character encoding byte. So QGIS has to operate with environmental variable “SHAPE_ENCODING”. At present the only solution is to use the same character coding for the given QGIS session, e.g.:
SHAPE_ENCODING=UTF-8 export SHAPE_ENCODING qgis
The example above allows to create and edit shape files with UTF-8 as a character encoding (example for Linux users, Windows users must use “SET SHAPE_ENCODING=UTF-8”).
------------------------------------------------
Excerpt from
http://trac.osgeo.org/gdal/wiki/ConfigOptions
In C/C++ configuration switches can be set programmatically like this:
#include "cpl_conv.h"
...
CPLSetConfigOption( "GDAL_CACHEMAX", "64" );
Normally a configuration option applies to all threads active in a program, but they can be limited to only the current thread this way:
CPLSetThreadLocalConfigOption( "GDAL_CACHEMAX", "64" );
由 zirneklitis - 更新于 一年以上 之前
The Linux example above should be as follows:
$ SHAPE_ENCODING=UTF-8
$ export SHAPE_ENCODING
$ qgis
shapefile 编码错误问题解决 Wrong codepage of shapefile Warning 1: One or several characters couldn't be converted correctly from UTF-8 to ISO-8859-1.的更多相关文章
- Python文件读取编码错误问题解决之(PyCharm开发工具默认设置的坑。。。)
刚接触Python学习,正准备做个爬虫的例子,谁知道代码一开始就遇到了一个大坑,狂汗啊. 问题是这样的:我通过代码爬取了博客园首页的HTML代码并存入到blog.txt文件当中,然后准备读取出来之后进 ...
- windows上使用pip下载东西时报编码错误问题解决方法
原因是pip安装python包会加载我的用户目录,我的用户目录恰好是中文的,ascii不能编码.解决办法是: python目录 Python27\Lib\site-packages 建一个文件site ...
- ruby -- 问题解决(四)编码错误导致无法显示(2)
从数据库中取得数据显示时报 incompatible character encodings: GBK and ASCII-8BIT或 incompatible character encodings ...
- ruby -- 问题解决(三)编码错误导致无法显示(1)
从数据库中取得数据显示时报 incompatible character encodings: GBK and ASCII-8BIT 或 incompatible character encoding ...
- 火狐firefox提示“内容编码错误 无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式。”
火狐firefox浏览器打开网也是时提示“内容编码错误 无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式.” 今早一来打开用PHPCMS做的网站时就提示这个错误,用其他浏览器打开提示的是 ...
- 记一次python编码错误
摘要: 断断续续写python一段时间了,让我说python最令我头疼的问题,莫过于编码问题.最近做大论文,使用python再次出现编码报错.错误如下: "UnicodeEncodeErro ...
- windows下编译java源文件的编码错误
import java.util.Arrays;public class ArrayAsAReference{ public static void main(String[] args) { int ...
- python编码错误
初学python,遇到的最难忘的坑没有之一.这个问题起码困扰了我一周.在我写了一段代码之后经常遇见这样的报错. 本质原因是我用的python2,在编码流派中python2是比较奇葩的一派,不随大流.所 ...
- linux 关于Apache默认编码错误 导致网站乱码的解决方案
Apache默认编码UTF-8在解析A网站的时候没有任何问题,当运行B网站时出现的"蝌蚪文"乱码问题 最近经常有同学在使用LAMP/WAMP时,遇到这样的编码错误问题: A网站 ...
随机推荐
- 两台linux机器时间同步
Linux自带了ntp服务 -- /etc/init.d/ntpd,这个服务不仅可以设置让本机和某台/某些机器做时间同步,他本身还可以扮演一个time server的角色,让其他机器和他同步时间. 配 ...
- ajax是怎么发请求的和浏览器发的请求一样吗?cookie
下午设置cookie时出现了个问题 用ajax发的post请求php,在php的方法里设置了cookie,然后在浏览器请求的php里打印cookie值但是一直获取不到cookie的值 分析: 1.aj ...
- nginx的 CPU参数worker_processes和worker_cpu_affinity使用说明
官方说明: http://wiki.nginx.org/NginxChsHttpMainModule#worker_cpu_affinity http://wiki.nginx.org/NginxCh ...
- Objective-C基础教程读书笔记(7)
第7章 深入了解Xcode Xcode是一个很好用的工具,有很多强大的功能,不过并不是所有的功能都易于发现.如果你打算长期使用这个强大的工具,就肯定要尽可能多了解它.本章将介绍一些Xcode编辑器的使 ...
- Memcached初体验及原理解说
1.简单介绍 Memcached 是一个 高性能的 分布式 内存对象缓存系统,用于动态Web应用降低数据库负载,提升性能. 2.试用场景 1.变化频繁,具有不稳定性的数据 (比方用户在线状态.在线人数 ...
- Mysql 的一些基本用法
一.增加字段 COMMENT '是否导入基础信息平台 1 是导入'; 二.删除字段 alter table `provincestudentinfo` drop column NativePlace; ...
- VS 2013--工程的创建,scanf报错,常用快捷键,行号设置
一.创建一个工程(这里是C++,其他的一样的) 在vs页面上点击 文件-->新建-->项目: 会出现如下界面,自己改名字和存贮位置就可以了 确定,然后点击下一步: 这样就建好了一个工程,然 ...
- Sprintf()的思考和引出的相关问题
Sprintf()为什么不安全? 功能 把格式化的数据写入某个 字符串 缓冲区. 头文件 stdio.h 原型 int sprintf( char *buffer, const char *forma ...
- Oracle同义词 synonyms
Oracle中的同义词: 总结:简单的一句话,Oracle中不同用户的表一般都只能够自己的所属的用户可以用,如果不想通过授权的方式授权给其他用户使用,那么创建表的时候在表名的前面加上 synonyms ...
- [javascript]一种兼容性比较好的简单拖拽
作为一个马上要找工作.非计算机专业.热爱前端的大四狗,最近开始疯狂写demo.看书,准备九.十月份的校招. 晚上用js实现了一个比较简单(low)的拖拽效果,初步测试兼容性还是不错的,于是写一段小博文 ...