Skip to content

Instantly share code, notes, and snippets.

@ybhwang
Created September 5, 2023 04:56
Show Gist options
  • Select an option

  • Save ybhwang/6384f92845bb1b5dae6b4ececf09267b to your computer and use it in GitHub Desktop.

Select an option

Save ybhwang/6384f92845bb1b5dae6b4ececf09267b to your computer and use it in GitHub Desktop.
How to fix post character instead of switched character to compatibility variant in Safari Browser.

Before

fetch(URL, {
  method: "POST",
  body: JSON.stringify({
    foo: bar
  }),
})

After

fetch(URL, {
  method: "POST",
  body: new TextEncoder("utf-8").encode(JSON.stringify({
    foo: bar
  })),
})

If the same problem persists, globally apply a font that does not treat the Unicode of the character in question as a compatible character too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment