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.的更多相关文章

  1. Python文件读取编码错误问题解决之(PyCharm开发工具默认设置的坑。。。)

    刚接触Python学习,正准备做个爬虫的例子,谁知道代码一开始就遇到了一个大坑,狂汗啊. 问题是这样的:我通过代码爬取了博客园首页的HTML代码并存入到blog.txt文件当中,然后准备读取出来之后进 ...

  2. windows上使用pip下载东西时报编码错误问题解决方法

    原因是pip安装python包会加载我的用户目录,我的用户目录恰好是中文的,ascii不能编码.解决办法是: python目录 Python27\Lib\site-packages 建一个文件site ...

  3. ruby -- 问题解决(四)编码错误导致无法显示(2)

    从数据库中取得数据显示时报 incompatible character encodings: GBK and ASCII-8BIT或 incompatible character encodings ...

  4. ruby -- 问题解决(三)编码错误导致无法显示(1)

    从数据库中取得数据显示时报 incompatible character encodings: GBK and ASCII-8BIT 或 incompatible character encoding ...

  5. 火狐firefox提示“内容编码错误 无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式。”

    火狐firefox浏览器打开网也是时提示“内容编码错误 无法显示您尝试查看的页面,因为它使用了无效或者不支持的压缩格式.” 今早一来打开用PHPCMS做的网站时就提示这个错误,用其他浏览器打开提示的是 ...

  6. 记一次python编码错误

    摘要: 断断续续写python一段时间了,让我说python最令我头疼的问题,莫过于编码问题.最近做大论文,使用python再次出现编码报错.错误如下: "UnicodeEncodeErro ...

  7. windows下编译java源文件的编码错误

    import java.util.Arrays;public class ArrayAsAReference{ public static void main(String[] args) { int ...

  8. python编码错误

    初学python,遇到的最难忘的坑没有之一.这个问题起码困扰了我一周.在我写了一段代码之后经常遇见这样的报错. 本质原因是我用的python2,在编码流派中python2是比较奇葩的一派,不随大流.所 ...

  9. linux 关于Apache默认编码错误 导致网站乱码的解决方案

    Apache默认编码UTF-8在解析A网站的时候没有任何问题,当运行B网站时出现的"蝌蚪文"乱码问题   最近经常有同学在使用LAMP/WAMP时,遇到这样的编码错误问题: A网站 ...

随机推荐

  1. java结构与算法之冒泡排序

    一.什么是冒泡排序:冒泡排序是在从相邻两个数之间进行比较,这里将前面一个值定义为before,后面一个值定义为after:当before>after时i,交换他们的值,如果before<a ...

  2. C指针陷阱

    问题一: #include <stdio.h> int main(int argc, char *argv[]) { ]={ ,,,, }; ); printf(),*(p-)); ; } ...

  3. Reverse Integer - Palindrome Number - 简单模拟

    第一个题目是将整数进行反转,这个题实现反转并不难,主要关键点在于如何进行溢出判断.溢出判断再上一篇字符串转整数中已有介绍,本题采用其中的第三种方法,将数字转为字符串,使用字符串比较大小的方法进行比较. ...

  4. ibatis缓存配置

    一.sqlmapconfig.xml <sqlMapConfig> <settings useStatementNamespaces="true"  cacheM ...

  5. ORA-00031: session marked for kill 标记要终止的会话

    原文转载处:http://moonsoft.itpub.net/post/15182/203828 一些ORACLE中的进程被杀掉后,状态被置为"killed",但是锁定的资源很长 ...

  6. Unity3D游戏开发之小地图的实现

    今天我们来讲一下在Unity3D中怎样实现小地图.首先,我们来一起看看终于实现的效果: 要实现小地图效果,须要实现对于小地图和角色的绘制,所以这里须要用到OnGUI()方法,我们一起来看代码: [cs ...

  7. html 中的块级元素 内联元素

    上一个礼拜,做crm项目,使用的大部分都是js,nodejs,ajax 的内容,但是今天我想写写关于html中的块级元素和内联元素 的东西. 首先,html 中的块级元素 内联元素 我们可以看到,这两 ...

  8. if语句之求一元二次方程

    思路:1.首先明白什么叫做一元二次方程,当a不等于0的时候,此方程是一元二次方程 2.根据公式derta=b*b-4*a*c来判断根的情况 ①derta>0时,方程有两个不相等的实根 ②dert ...

  9. iOS开发之理解iOS中的MVC设计模式

    模型-视图-控制器(Model-View-Controller,MVC)是Xerox PARC在20世纪80年代为编程语言Smalltalk-80发明的一种软件设计模式,至今已广泛应用于用户交互应用程 ...

  10. Cin、Cout 加快效率方法

    std::ios::sync_with_stdio(false); 在main 函数中加上这么一句话. 可以打消iostream的输入输出缓存,可以节省许多时间,使效率与scanf与printf相差无 ...