datamodel-code-generator icon indicating copy to clipboard operation
datamodel-code-generator copied to clipboard

code generat fail, if json contain specific chinese

Open iridescentGray opened this issue 1 year ago • 2 comments

Describe the bug if json contain specific chinese, code generat will fail. specific chinese like :陳

To Reproduce

Example schema:


{
  "nickName": "陳老師",
}


Used commandline:

$ datamodel-codegen  --input test_json_data.json --input-file-type json --output test_json_data_model.py

Expected behavior success generat if json contain specific chinese

Version:

  • OS: [e.g. iOS] windows
  • Python version: 3.10.11
  • datamodel-code-generator version: [e.g. 22] 0.25.2

Additional context Add any other context about the problem here.

iridescentGray avatar Jan 12 '24 02:01 iridescentGray

more fail specific chinese like : 王,黑,白

iridescentGray avatar Jan 12 '24 02:01 iridescentGray

not all chinese have this problem, There is no problem below: 老师,测试

iridescentGray avatar Jan 12 '24 02:01 iridescentGray