| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script> | |
| 4 function log(str) { | |
| 5 var li = document.createElement("li"); | |
| 6 li.appendChild(document.createTextNode(str)); | |
| 7 var console = document.getElementById("console"); | |
| 8 console.appendChild(li); | |
| 9 } | |
| 10 | |
| 11 function convertStringToUnicode(string) | |
| 12 { | |
| 13 var returnValue = " (character in Unicode value): "; | |
| 14 for (var i = 0; i < string.length; ++i) | |
| 15 { | |
| 16 returnValue += " " + string.charCodeAt(i); | |
| 17 } | |
| 18 return returnValue; | |
| 19 } | |
| 20 | |
| 21 function assertEqual(test_name, actual, expected) | |
| 22 { | |
| 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); | |
| 28 log(actual_string); | |
| 29 log(expected_string); | |
| 30 } | |
| 31 } | |
| 32 | |
| 33 onload = function() | |
| 34 { | |
| 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\u00
09a\u0308"); | |
| 41 } | |
| 42 </script> | |
| 43 </head> | |
| 44 <body> | |
| 45 <div id="div">क़उ	ä</div> | |
| 46 <ul id="console"></ul> | |
| 47 </body> | |
| 48 </html> | |
| OLD | NEW |