nzakas / understandinges6

Content for the ebook "Understanding ECMAScript 6"
5.45k stars 796 forks source link

Chapter 8 – bad encoding in String Iterators example #425

Open rsmeral opened 6 years ago

rsmeral commented 6 years ago

The examples in the String Iterators section contain this in the source:

var message = "A 𠮷 B";

and later

A
(blank)
𠮷
(blank)
B

However, it renders as:

var message = "A ð ®· B";

and

A
(blank)
ð ®·
(blank)
B

The error happens before the HTML gets to the client. In other words, it's not a decoding error. A ð ®· B are the actual characters that arrive from the server.

pamelafox commented 1 year ago

I believe the same issue happens in the Symbols chapter.

The comment says: "console.log(String(freezing)); // "32째"

But the code says: console.log(String(freezing)); // "32°"

https://github.com/nzakas/understandinges6/blob/master/manuscript/06-Symbols.md