published: python3 -c 'import sys;t=open(sys.argv[1],encoding="utf-8",newline="").read();print(len(t.encode("utf-16-le"))//2)' bio.txt run: python3 -c 'import sys;t=open(sys.argv[1],encoding="utf-8",newline="").read();print(len(t.encode("utf-16-le"))//2)' bio-draft-2.txt output: 138 exit=0 published: node -e 'const t=require("fs").readFileSync(process.argv[1],"utf8");console.log([...new Intl.Segmenter("en",{granularity:"grapheme"}).segment(t)].length)' bio.txt run: node -e 'const t=require("fs").readFileSync(process.argv[1],"utf8");console.log([...new Intl.Segmenter("en",{granularity:"grapheme"}).segment(t)].length)' bio-draft-2.txt output: 136 exit=0 published: python3 -c 'import sys;t=open(sys.argv[1],encoding="utf-8",newline="").read();print(len(t.encode("utf-16-le"))//2)' bio.txt run: python3 -c 'import sys;t=open(sys.argv[1],encoding="utf-8",newline="").read();print(len(t.encode("utf-16-le"))//2)' bio-edge.txt output: 37 exit=0 edge: ZWJ family emoji, CRLF line break and a decomposed e+U+0301 in the file; the test file has none of these (expected: UTF-16 37, graphemes 28 against the Python and Node counts above); the Word counter shows 36 for the same text because the browser box turns CRLF into one line feed (live tool: A\r\nB gives 3, this command on a file gives 4) published: node -e 'const t=require("fs").readFileSync(process.argv[1],"utf8");console.log([...new Intl.Segmenter("en",{granularity:"grapheme"}).segment(t)].length)' bio.txt run: node -e 'const t=require("fs").readFileSync(process.argv[1],"utf8");console.log([...new Intl.Segmenter("en",{granularity:"grapheme"}).segment(t)].length)' bio-edge.txt output: 28 exit=0 edge: ZWJ family emoji, CRLF line break and a decomposed e+U+0301 in the file; the test file has none of these (expected: UTF-16 37, graphemes 28 against the Python and Node counts above)