| 1 |
wakaba |
1.1 |
#!/usr/bin/perl |
| 2 |
|
|
use strict; |
| 3 |
|
|
|
| 4 |
|
|
print qq[Content-Type: text/html; charset=utf-8\n\n]; |
| 5 |
|
|
print qq[<!DOCTYPE HTML>]; |
| 6 |
|
|
print qq[<p>U-01000401: ]; |
| 7 |
|
|
print qq[<span>\xf9\x80\x80\x90\x81</span>]; |
| 8 |
|
|
print q[ |
| 9 |
|
|
<p id=result class=FAIL>FAIL (noscript)</p> |
| 10 |
|
|
<script> |
| 11 |
|
|
var r = document.getElementById ('result'); |
| 12 |
|
|
r.firstChild.data = 'FAIL (script)'; |
| 13 |
|
|
var s = document.getElementsByTagName ('span')[0]; |
| 14 |
|
|
if (s.firstChild.data.match (/^\uFFFD{1,5}$/)) { |
| 15 |
|
|
r.firstChild.data = 'PASS'; |
| 16 |
|
|
r.className = 'PASS'; |
| 17 |
|
|
} else { |
| 18 |
|
|
r.firstChild.data = 'FAIL'; |
| 19 |
|
|
} |
| 20 |
|
|
</script> |
| 21 |
|
|
<p>NOTE: IANA definition for <code>UTF-8</code> references RFC 3629, |
| 22 |
|
|
which in turn normatively references the Unicode Standard. They don't |
| 23 |
|
|
allow characters greater than U+10FFFF. |
| 24 |
|
|
]; |