js-shapefile-to-geojson icon indicating copy to clipboard operation
js-shapefile-to-geojson copied to clipboard

js-shapefile-to-geojson read chinese(solved)

Open mygoodboy opened this issue 6 years ago • 3 comments

¤j®a¦n(大家好) I can not find how to convert to chinese I do not very know unicode but I try big-5 , utf-8 and convert online tool but it is still wrong

please help me thank !

mygoodboy avatar Apr 18 '18 23:04 mygoodboy

I have the same problem, have you solved it?

swaggyPYang avatar Sep 22 '18 03:09 swaggyPYang

1.change encode dbf.js xhr.overrideMimeType("text/plain; charset=x-user-defined") to xhr.overrideMimeType("text/plain; charset=big5") 2. big5 need 4 (2 char) but ascii only 2 (1 char) stream.js for(var i = 0; data[i]; i++){ buff.push(fromCharCode(data.charCodeAt(i) & 0xff)); } to for(var i = 0; data[i]; i++){

        buff.push(fromCharCode(data.charCodeAt(i) )); 

        if((data.charCodeAt(i) & 0xff) != data.charCodeAt(i)){
            t.length++;
            buff.push(fromCharCode(32 )); //空白
        }

}

mygoodboy avatar Dec 20 '18 09:12 mygoodboy

thanks ,I solved it.

swaggyPYang avatar Dec 20 '18 09:12 swaggyPYang