wbuchanan/StataJSON

The program does not support Reading in Chinese character

Opened this issue · 4 comments

hello!
When I using this program "jsonio" ,I found that this program does not read JSON file well when the file concludes Chinese character same as "北京市".These characters will be converted to "???" in Stata.
This problem has a very negative impact on Chinese users.

here is a example JSON file

{
            "city_id": 158,
            "city_name": "长沙市",
            "location":
            {
                "lng": 112.95032970443,
                "lat": 28.185608728934
            }
}

Thank you :)

@Stata-Club
Is there a specific API returning these data? Do you know what string encoding is being used for the payload? And which version of Stata are you using?

I just tested things with the JSON object you provided above and the characters were correctly read. Perhaps it is an issue with specifying the string encoding within Stata?

Connected to the target VM, address: '127.0.0.1:51096', transport: 'socket'
Key = 	/city_id	Value =	158
Key = 	/city_name	Value =	"长沙市"
Key = 	/location/lng	Value =	112.95032970443
Key = 	/location/lat	Value =	28.185608728934
Disconnected from the target VM, address: '127.0.0.1:51096', transport: 'socket'
Index = 0
Index = 1
Index = 2
Index = 3
Started Job at: 2017/11/01 15:02:05
Ended Job at : 2017/11/01 15:02:52
4 elements total
/city_id
/city_name
/location/lng
/location/lat

Process finished with exit code 0

The program does not support Writing in Chinese character! what should I do?

@Stata-Club
I don’t think insheetjson provides a viable solution for writing JSON data to a file. I still haven’t had a chance to look into the issues with writing to disk, but think it might be related to the accessor methods from the Java API from version 14. Once I am able to look into things and verify I will update the issue.