File:  [parser3project] / parser3 / tests / 343.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Aug 2 14:56:21 2016 UTC (9 years, 11 months ago) by moko
Branches: MAIN
CVS tags: release_3_5_1, release_3_5_0, release_3_4_6, release_3_4_5, HEAD
tests for ^file::create[ $.from-charset and $.to-charset ] (related to feature #1061)

@main[]

$f1[^file::create[ั‚ะตัั‚]]
^show[f1;$f1]

$f2[^file::create[$f1; $.to-charset[windows-1251] $.content-type[text/plain^; charset=Windows-1251] ]]
^show[f2;$f2]

$f3[^file::create[$f2; $.mode[binary] ]]
^show[f2 binary;$f3]

$f[^file::create[$f2; $.mode[text] ]]
^show[f text from text, no transcode;$f]

$f[^file::create[$f3]]
^show[binary from binary, no transcode;$f]

$f[^file::create[$f2; $.from-charset[Windows-1251] ]]
^show[f text from text with transcode;$f]

$f[^file::create[$f3; $.mode[text] ]]
^show[f text from binary, automatic transcode;$f]

^try-catch{ ^file::create[$f3; $.no-such-option[] ] }
^try-catch{ ^file::create[$f3; $.from-charset[Windows-1251] ] }
^try-catch{ ^file::create[$f2; $.mode[binary] $.from-charset[Windows-1251] ] }

@show[title;f]
$title : ^json:string[$f; $.file[text] ]

E-mail: