Quantcast
Viewing all articles
Browse latest Browse all 2341

Commented Issue: chinese text labels sometimes casue crash [24278]

I use both mapwindows4.8.6 and mapwingis4.8 to label the china city names. When the number of the city name is small, it seems work fine. But when I have to deel with many city names, always it will crash after the program run a few time(like just zoomin and zoomout quickly for a few time).

In this page, gischai's last modify seems try to fix the problem I have now, but the edition he fixed is not mentioned, so I have no idea how to fix it in the mapwingis4.8.

http://www.mapwindow.org/phorum/read.php?7,12162,page=1

_(2)、MapWindow\Data\Vectors\internal\Shapefiles\AttribuTable.cs
修改了ReadTableHeader(BinaryReader reader)函数
将以下3行:
read the field name
char[] buffer = new char[11];
buffer = reader.ReadChars(11);
string name = new string(buffer);
修改为:
byte[] buffer = new byte[11];
buffer = reader.ReadBytes(11);//如果不这样做,就会在后面的读取中,造成读取移位,出错。
string name = System.Text.Encoding.Default.GetString(buffer);
//这样就可以正确读取dbf文件中各字段的中文信息了。_

At last, I attached the shp file, wish it can help to find the bug.
Comments: ** Comment from web user: sleschinski **

Reviewing it before 4.9.3 beta release: for the sample shapefile with my regular OS language settings the labels were displayed as gibberish. But when I changed Region -> Format to Simplified Chinese they were displayed fine. There were no crashes or error messages. I also checked it for memory leaking with Deleaker tool - no leaks. So from my point of view everything works as it should be in the new version.

P.S. It would be great to use Unicode for labels (not to depend on OS locale). As far as Labels class goes it's fairly easy. However the problem is in DBF which use ANSI encoding in most cases. QGis has the same problems with non-Chinese locale.


Viewing all articles
Browse latest Browse all 2341

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>