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

fix utf8 handling when importing json #14168

Merged
merged 4 commits into from
Sep 26, 2024
Merged

fix utf8 handling when importing json #14168

merged 4 commits into from
Sep 26, 2024

Conversation

snoglobe
Copy link
Contributor

What does this PR do?

this closes #10851 - when importing JSON files, strings were encoded as utf8 which caused problems when evaluated in js core

  • Documentation or TypeScript types (it's okay to leave the rest blank in this case)
  • Code changes

How did you verify your code works?

Copy link
Member

@paperdave paperdave left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im realizing an existing problem with this code, which is that there are 5 or so of these JSON parse functions which are all identical but have slightly different things. the perfect world makes this one single function, which can be configured as needed.

but that has no runtime difference, and neither does this. lgtm

@paperdave paperdave self-assigned this Sep 25, 2024
@dylan-conway
Copy link
Collaborator

im realizing an existing problem with this code, which is that there are 5 or so of these JSON parse functions which are all identical but have slightly different things. the perfect world makes this one single function, which can be configured as needed.

I agree, json_parser.zig needs a cleanup

@Jarred-Sumner Jarred-Sumner merged commit af12ff1 into main Sep 26, 2024
47 checks passed
@Jarred-Sumner Jarred-Sumner deleted the snoglobe/utf8_fix branch September 26, 2024 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Importing .json with non-ascii characters within bun build --target=bun does not encode to disk as latin1
5 participants