Index: trunk/phase3/tests/qunit/suites/resources/jquery/jquery.byteLength.js |
— | — | @@ -23,16 +23,20 @@ |
24 | 24 | } ); |
25 | 25 | |
26 | 26 | test( 'Special text', window.foo = function() { |
27 | | - expect(4); |
| 27 | + expect(5); |
28 | 28 | |
29 | 29 | // http://en.wikipedia.org/wiki/UTF-8 |
30 | 30 | var U_0024 = '\u0024', |
31 | 31 | U_00A2 = '\u00A2', |
32 | 32 | U_20AC = '\u20AC', |
33 | | - U_024B62 = '\u024B62'; |
| 33 | + U_024B62 = '\u024B62', |
| 34 | + // The normal one doesn't display properly, try the below which is the same |
| 35 | + // according to http://www.fileformat.info/info/unicode/char/24B62/index.htm |
| 36 | + U_024B62_alt = '\uD852\uDF62'; |
34 | 37 | |
35 | | - strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte (dollar sign) $' ); |
36 | | - strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes (cent sign) ¢' ); |
37 | | - strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes (euro sign) €' ); |
38 | | - strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes 𤭢 \U00024B62 ' ); |
| 38 | + strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte. \u0024 (dollar sign)' ); |
| 39 | + strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes. \u00A2 (cent sign)' ); |
| 40 | + strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes. \u20AC (euro sign)' ); |
| 41 | + strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character)' ); |
| 42 | + strictEqual( $.byteLength( U_024B62_alt ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character) - alternative method' ); |
39 | 43 | } ); |