mastodon.zunda.ninja is one of the many independent Mastodon servers you can use to participate in the fediverse.
Zundon is a single user instance as home of @zundan as well as a test bed for changes of the code.

Administered by:

Server stats:

1
active users

本当は怖いUTF-16

$ irb
> "𠮷".encode("UTF-8").length
=> 1
> "𠮷".encode("UTF-16").length
=> 2

@zundan node.jsがソースコードをUTF-8からUTF-16に変換するのはnode.jsの内部仕様で固定っぽいですね。 stackoverflow.com/questions/10

JavaScriptが文字列を内部で16ビット文字の集合として取り扱う話は stackoverflow.com/questions/87 で、コメントによるとUTF-16ではない文字列も許容される。 isWellFormed() で判定できる。とのこと

Stack OverflowWhat encoding is expected for Node.js source code?I’ve done some Google searches, but I get results related to encoding strings or files. Can I write my Node.js JavaScript source code in UTF-8? Can I use non-ASCII characters in comments, strings,...
zunda

@tateisu なるほどなるほどありがとうございます!OpenPGP.jsなどをいじっていると、他にバイナリの配列もみかけたりで、なかなか奥が深そうです