File: nbsp.html

package info (click to toggle)
elinks 0.19.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 24,424 kB
  • sloc: ansic: 174,653; cpp: 31,967; sh: 7,841; python: 4,039; perl: 2,183; javascript: 1,794; pascal: 1,710; makefile: 1,006; yacc: 295; lisp: 125; awk: 79; ruby: 70
file content (84 lines) | stat: -rw-r--r-- 3,872 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"
	"http://www.w3.org/TR/REC-html40/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=macintosh">
<meta http-equiv="Content-Script-Type" content="application/ecmascript">
<title>non-breaking space in forms (ELinks bug 811)</title>
<h1>non-breaking space in forms (ELinks bug 811)</h1>

<p>Setting protocol.http.trace = 1 and ecmascript.enable = 1 may be a good idea.</p>

<table>
<tr><th>Unicode<th>macintosh<th>koi8-r<th>cp850
<tr><td>U+0001 &#x0001;<td>0x01<td>-<td>0x01
<tr><td>U+00A0 &#x00A0;<td>0xCA<td>0x9A<td>0xFF
<tr><td>U+00F7 &#x00F7;<td>0xD6<td>0x9F<td>0xF6
</table>

<h2>GET without accept-charset; ambient macintosh</h2>
<form name="form1" action="http://localhost:60000/" method="GET">
<p><input type="reset"><input type="button" onclick="prepare('1')" value="Run script"><input type="submit">
<table>
<tr><td><th>Input<th>List of characters
<tr><td>Please type a non-breaking space:<td><input name="a1"><td><input id="a1p" readonly size="30">
<tr><td>Pre-filled non-breaking spaces:<td><input name="b1" value="&nbsp;&#160;&#xa0;"><td><input id="b1p" readonly size="30">
<tr><td>U+0001 U+00A0 U+00F7 from script:<td><input name="c1"><td><input id="c1p" readonly size="30">
</table>
</form>

<h2>POST without accept-charset; ambient macintosh</h2>
<form name="form2" action="http://localhost:60000/" method="POST" enctype="multipart/form-data">
<p><input type="reset"><input type="button" onclick="prepare('2')" value="Run script"><input type="submit">
<table>
<tr><td><th>Input<th>List of characters
<tr><td>Please type a non-breaking space:<td><input name="a2"><td><input id="a2p" readonly size="30">
<tr><td>Pre-filled non-breaking spaces:<td><input name="b2" value="&nbsp;&#160;&#xa0;"><td><input id="b2p" readonly size="30">
<tr><td>U+0001 U+00A0 U+00F7 from script:<td><input name="c2"><td><input id="c2p" readonly size="30">
</table>
</form>

<h2>GET with accept-charset="koi8-r, cp850"; ambient macintosh</h2>
<form name="form3" action="http://localhost:60000/" method="GET" accept-charset="koi8-r, cp850">
<p><input type="reset"><input type="button" onclick="prepare('3')" value="Run script"><input type="submit">
<table>
<tr><td><th>Input<th>List of characters
<tr><td>Please type a non-breaking space:<td><input name="a3"><td><input id="a3p" readonly size="30">
<tr><td>Pre-filled non-breaking spaces:<td><input name="b3" value="&nbsp;&#160;&#xa0;"><td><input id="b3p" readonly size="30">
<tr><td>U+0001 U+00A0 U+00F7 from script:<td><input name="c3"><td><input id="c3p" readonly size="30">
</table>
</form>

<h2>POST with accept-charset="koi8-r, cp850"; ambient macintosh</h2>
<form name="form4" action="http://localhost:60000/" method="POST" enctype="multipart/form-data" accept-charset="koi8-r, cp850">
<p><input type="reset"><input type="button" onclick="prepare('4')" value="Run script"><input type="submit">
<table>
<tr><td><th>Input<th>List of characters
<tr><td>Please type a non-breaking space:<td><input name="a4"><td><input id="a4p" readonly size="30">
<tr><td>Pre-filled non-breaking spaces:<td><input name="b4" value="&nbsp;&#160;&#xa0;"><td><input id="b4p" readonly size="30">
<tr><td>U+0001 U+00A0 U+00F7 from script:<td><input name="c4"><td><input id="c4p" readonly size="30">
</table>
</form>

<script type="application/ecmascript">
function prepare(num) {
  var form = window.document.forms["form" + num];
  form.elements["c" + num].value = "\u0001\u00a0\u00f7";
  var expose = function(elname) {
    var src = form.elements[elname].value;
    var dst = "";
    for (var i = 0; i < src.length; ++i) {
      dst += "U+" + src.charCodeAt(i).toString(16) + " ";
    }
    form.elements[elname + "p"].value = dst;
  };
  expose("a" + num);
  expose("b" + num);
  expose("c" + num);
  return false;
}
</script>

<!--
Local Variables:
coding: mac-roman
End:
-->