Annotation of parser3/tests/344.html, revision 1.5
1.1 moko 1: @main[]
2: ^from-1251[]
3:
4: $f1[^file::load[binary;247_utf8_bom.txt]]
5: ^show[f1;$f1]
6:
7: $f[^file::create[$f1; $.mode[text] ]]
8: ^show[f text from binary, automatic transcode by UTF-8 preambule;$f]
9:
1.2 moko 10: $f[^file::create[$f1; $.mode[text] $.content-type[text/plain^; charset=Windows-1251] ]]
11: ^show[f text from binary no transcode as charset specified in content-type;$f]
12:
13: $f[^file::create[$f1; $.mode[text] $.from-charset[Windows-1251] ]]
14: ^show[f text from binary no transcode as from-charset specified;$f]
15:
16: $f1[^file::load[binary;247_utf8.txt]]
17: ^show[f1;$f1]
18:
19: $f[^file::create[$f1; $.mode[text] ]]
20: ^show[f text from binary, no transcode;$f]
21:
22: $f[^file::create[$f1; $.mode[text] $.from-charset[UTF-8] ]]
23: ^show[f text from binary transcode using from-charset;$f]
24:
1.3 moko 25: ^try-catch{ ^file::create[$f1; $.to-charset[UTF-8] $.charset[UTF-8] ] }
26:
1.4 moko 27: code coverage tests:
28:
29: $f1[^file::load[text;247_utf8_bom.txt; $.limit[8] $.offset[5] $.charset[UTF-8] ]]
30: ^show[f1;$f1]
31:
1.5 ! moko 32: $f[^file::create[test]]
! 33: ^json:string[^hash::create[$f]]
1.4 moko 34:
1.1 moko 35: @show[title;f]
1.3 moko 36: $title : {
37: "name":"$f.name",
38: "size":$f.size,
39: "mode":"$f.mode",
40: "content-type":"^taint[json;$f.content-type]",
41: "text":"$f.text"
42: }
E-mail: