Created
April 19, 2010 00:08
-
-
Save horatio-sans-serif/370636 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~ ⚡ node /tmp/readself.js | |
length=214 | |
// start of file readself.js | |
sys=require("sys"); | |
fs=require("fs"); | |
contents=fs.readFileSync(__filename, encoding="utf8"); // ö日本語 | |
sys.puts("length="+contents.length); | |
sys.puts(contents); | |
// end of file readself.js | |
~ ⚡ wc -c /tmp/readself.js | |
221 /tmp/readself.js |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"ö日本語" is four characters, and in UTF-8 "ö" is two bytes and the Han characters are each 3 bytes, so you have 7 bytes more than characters.