Skip to content

Commit cf641d4

Browse files
authored
Unicode
1 parent 6bbe0b4 commit cf641d4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

1-js/05-data-types/03-string/article.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ You can skip the section if you don't plan to support them.
558558

559559
### Surrogate pairs
560560

561-
Most symbols have a 2-byte code. Letters in most european languages, numbers, and even most hieroglyphs, have a 2-byte representation.
561+
All frequently used characters have 2-byte codes. Letters in most european languages, numbers, and even most hieroglyphs, have a 2-byte representation.
562562

563563
But 2 bytes only allow 65536 combinations and that's not enough for every possible symbol. So rare symbols are encoded with a pair of 2-byte characters called "a surrogate pair".
564564

@@ -628,7 +628,7 @@ For instance:
628628

629629
```js run
630630
alert( 'S\u0307\u0323' ); // Ṩ, S + dot above + dot below
631-
alert( 'S\u0323\u0307' ); // Ṩ, S + dot below + dot above
631+
alert( 'S\u0323\u0307' ); // Ṩ, S + dot below + dot above
632632

633633
alert( 'S\u0307\u0323' == 'S\u0323\u0307' ); // false
634634
```
@@ -649,7 +649,7 @@ alert( "S\u0307\u0323".normalize().length ); // 1
649649
alert( "S\u0307\u0323".normalize() == "\u1e68" ); // true
650650
```
651651

652-
In reality, this is not always the case. The reason being that the symbol `Ṩ` is "common enough", so UTF-16 creators included it in the main table and gave it the code.
652+
In reality, this is not always the case. The reason being that the symbol `` is "common enough", so UTF-16 creators included it in the main table and gave it the code.
653653

654654
If you want to learn more about normalization rules and variants -- they are described in the appendix of the Unicode standard: [Unicode Normalization Forms](http://www.unicode.org/reports/tr15/), but for most practical purposes the information from this section is enough.
655655

0 commit comments

Comments
 (0)