Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read exported hero with BOM #370

Closed
floriankramer opened this issue Feb 6, 2020 · 3 comments
Closed

Cannot read exported hero with BOM #370

floriankramer opened this issue Feb 6, 2020 · 3 comments
Assignees
Labels
Bug A bug Domain: IO Related to file input/output, which includes things like import/export
Milestone

Comments

@floriankramer
Copy link

Describe the bug
After creating a character and before finishing it I exported the character and was afterwards unable to import it again.

To Reproduce
I'm uncertain how to reproduce this (it doesn't fail in general, just for this character). This is the character's json (I changed the file extension for github):
Astrid_Moonfall.txt

Expected behavior
The import of the json should work.

Environment

  • OS: Windows 10
  • Version 1.2.0
@elyukai elyukai added Bug A bug Domain: IO Related to file input/output, which includes things like import/export labels Feb 6, 2020
@elyukai elyukai added this to the 1.3 milestone Feb 6, 2020
@elyukai
Copy link
Owner

elyukai commented Feb 6, 2020

Thanks for reporting! :) I'm gonna look into that.

@floriankramer
Copy link
Author

I talked to the friend who originally created the character again. He recreated the character, and after comparing the export of the recreation and the original it appears that he opened the json in an editor and saved it unchanged. The editor prepended the file with a byte order mark (EF BB BF) which causes the import to fail with {} as the errormessage.

@elyukai
Copy link
Owner

elyukai commented Feb 20, 2020

I added a function that strips the UTF-8 BOM.

@elyukai elyukai changed the title Unable to import a character right after exporting it Cannot read exported hero with BOM Feb 20, 2020
@elyukai elyukai self-assigned this Feb 20, 2020
@elyukai elyukai mentioned this issue Mar 3, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Domain: IO Related to file input/output, which includes things like import/export
Projects
None yet
Development

No branches or pull requests

2 participants