From 7cf5ed509472eace7741b1bf736b0cbd4ac8e3e4 Mon Sep 17 00:00:00 2001 From: Krinkle Date: Thu, 30 Jun 2011 01:20:37 +0000 Subject: [PATCH] Adding alternative method for U+024B62. Making sure both ways work. --- .../resources/jquery/jquery.byteLength.js | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/qunit/suites/resources/jquery/jquery.byteLength.js b/tests/qunit/suites/resources/jquery/jquery.byteLength.js index 10628b046f..f82fda27b3 100644 --- a/tests/qunit/suites/resources/jquery/jquery.byteLength.js +++ b/tests/qunit/suites/resources/jquery/jquery.byteLength.js @@ -23,16 +23,20 @@ test( 'Simple text', function() { } ); test( 'Special text', window.foo = function() { - expect(4); + expect(5); // http://en.wikipedia.org/wiki/UTF-8 var U_0024 = '\u0024', U_00A2 = '\u00A2', U_20AC = '\u20AC', - U_024B62 = '\u024B62'; - - strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte (dollar sign) $' ); - strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes (cent sign) ¢' ); - strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes (euro sign) €' ); - strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes 𤭢 \U00024B62 ' ); + U_024B62 = '\u024B62', + // The normal one doesn't display properly, try the below which is the same + // according to http://www.fileformat.info/info/unicode/char/24B62/index.htm + U_024B62_alt = '\uD852\uDF62'; + + strictEqual( $.byteLength( U_0024 ), 1, 'U+0024: 1 byte. \u0024 (dollar sign)' ); + strictEqual( $.byteLength( U_00A2 ), 2, 'U+00A2: 2 bytes. \u00A2 (cent sign)' ); + strictEqual( $.byteLength( U_20AC ), 3, 'U+20AC: 3 bytes. \u20AC (euro sign)' ); + strictEqual( $.byteLength( U_024B62 ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character)' ); + strictEqual( $.byteLength( U_024B62_alt ), 4, 'U+024B62: 4 bytes. \uD852\uDF62 (a Han character) - alternative method' ); } ); -- 2.20.1