Opened 5 years ago

Last modified 5 years ago

#13143 new Bugs

boost read_json throw exception when the json file has some gbk chinese charactor

Reported by: Li Da <sculida@…> Owned by: Sebastian Redl
Milestone: To Be Determined Component: property_tree
Version: Boost 1.64.0 Severity: Problem
Keywords: Cc:

Description

there is a json file like this, without bom, use gbk code set. The boost::property_tree can parse it successfully in the majority.

try {
    boost::property_tree::read_json(filename, tree);
}
catch (exception &e) {
    cerr << e.what() << endl;
}

However, if the file has chinese character"历"(c0fa)or"繞"(c040), the property_tree will throw exception"invalid code sequence"

Change History (1)

comment:1 by Li Da <sculida@…>, 5 years ago

the code set gbk is simalar to gb2312,gb18030

Note: See TracTickets for help on using tickets.