lann / wasm-wave

Web Assembly Value Encoding
Apache License 2.0
38 stars 6 forks source link

Implement Unicode escapes. #1

Closed sunfishcode closed 1 year ago

sunfishcode commented 1 year ago

Implement Unicode escapes, using ES6-like \u{···} syntax.

I also propose removing the '\x??' syntax, and exclusively using '\u{···}'. The rationale is that '\u{···}' can represent all the ASCII codepoints, so '\x??' would be redundant. And, component-model strings are sequences of Unicode Scalar Values, and not byte sequences.

lann commented 1 year ago

Thanks! I was only really familiar with "old-style" \uXXXX unicode escapes; ~I assume this form doesn't let you encode unpaired surrogates?~ Never mind I see the test cases!