How to avoid browsers Unicode normalization when submitting a form with Unicode

后端 未结 3 1795
鱼传尺愫
鱼传尺愫 2021-02-07 10:12

When rendering the following Unicode text in HTML, it turns out that the browser (Google Chrome) do some form of Unicode normalization when posting the data back to the server.

3条回答
  •  终归单人心
    2021-02-07 10:47

    You can manipulate the text on the client side before you submit. If inserting a Combining Grapheme Joiner works, you could insert it via JavaScript.

    As a staring point, but here's a JSFiddle that gets the characters letter by letter (tested in Safari and it doesn't normalize text): http://jsfiddle.net/TmtnA/

提交回复
热议问题