5 var li
= document
.createElement("li");
6 li
.appendChild(document
.createTextNode(str
));
7 var console
= document
.getElementById("console");
8 console
.appendChild(li
);
11 function convertStringToUnicode(string
)
13 var returnValue
= " (character in Unicode value): ";
14 for (var i
= 0; i
< string
.length
; ++i
)
16 returnValue
+= " " + string
.charCodeAt(i
);
21 function assertEqual(test_name
, actual
, expected
)
23 if (actual
!= expected
) {
24 log("==================================");
25 log("FAILED: " + test_name
);
26 var actual_string
= "actual" + convertStringToUnicode(actual
);
27 var expected_string
= "expected" + convertStringToUnicode(expected
);
35 if (window
.testRunner
)
36 testRunner
.dumpAsText();
37 var div
= document
.getElementById("div");
38 var string
= div
.innerHTML
;
39 //should be rendered as "\u0958\u0909 \u00e4" in html.
40 assertEqual("devanagari + a with diaeresis", string
, "\u0915\u093c\u0909\u0009a\u0308");
45 <div id=
"div">क़उ	a
̈</div>
46 <ul id=
"console"></ul>