Go source code is Unicode text encoded in UTF-8. (Source.)
GopherJS fails to process some unicode characters in Go code and emits JavaScript that does not print the correct characters.
I think it fails on "astral planes", or unicode characters that require more than 2 bytes using utf-8 encoding. But this is just a hypothesis from limited evidence/investigation.
Compare:
console.log("Hello, 世界. 😀!"); // U+1F600 emoji.
package main import "fmt" func main() { fmt.Println("Hello, 世界. 😀!") // U+1F600 emoji. }
https://play.golang.org/p/M1rXP8bm6L
http://www.gopherjs.org/playground/
(You'll have to manually paste the code into GopherJS Playground. Due to the bug in GopherJS, the snippet cannot be loaded correctly.)
Thank you to @peggyl for the original report of this issue at https://gist.github.com/peggyl/72d47f6652d30a4f566a!
Relevant ReadingRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4