Skip to content

[Xmlb, JSON] Issue with some special characters #8

@ak2yny

Description

@ak2yny

Steps to reproduce:

  • Try to compile legal_360.json using installed raven-formats with xmlb legal_360.json legal_360.engb

Error message:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\x\AppData\Local\Programs\Python\Python312\Scripts\xmlb.exe\__main__.py", line 7, in <module>
  File "C:\Users\x\AppData\Local\Programs\Python\Python312\Lib\site-packages\raven_formats\xmlb.py", line 236, in main
    compile(input_file, output_file)
  File "C:\Users\x\AppData\Local\Programs\Python\Python312\Lib\site-packages\raven_formats\xmlb.py", line 206, in compile
    data = json.load(json_file, object_pairs_hook=parse_json_object_pairs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\x\AppData\Local\Programs\Python\Python312\Lib\json\__init__.py", line 293, in load
    return loads(fp.read(),
                 ^^^^^^^^^
  File "<frozen codecs>", line 322, in decode
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc5 in position 2467: invalid continuation byte

Platform information:

  • Windows-11-10.0.22621-SP0
  • Python 3.12.1 (tags/v3.12.1:2305ca5, Dec 7 2023, 22:03:25) [MSC v.1937 64 bit (AMD64)] on win32
  • Raven-Formats v1.6
    (Note: Other JSON programs on my machine seem to have the same issue)

Things I tried:

  • Replace Å, é, and á in the source JSON file -> worked
  • Convert the file to XML and compile with xmlb legal_360.xml legal_360.engb -> worked
  • Use the converter of ak2yny's version to convert to XML -> failed (same error)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions