File:  [parser3project] / parser3 / tests / 247.html
Revision 1.1: download - view: text, annotated - select for diffs - revision graph
Tue Aug 10 05:35:01 2010 UTC (16 years, 1 month ago) by misha
Branches: MAIN
CVS tags: release_3_4_3, release_3_4_2, release_3_4_1, HEAD
- test for "transcode file from utf-8 to $request:charset during loading if the BOM code is detected"

@main[]
# checking for UTF-8 auto detection (BOM code)
^1251[]
$response:content-type[
	$.value[text/html]
	$.charset[$response:charset]
]

^load[file in UTF-8 with BOM. charset isn't specified;247_utf8_bom.txt]
^load[file in UTF-8 with BOM. UTF-8 charset is specified;247_utf8_bom.txt;UTF-8]
#^load[247_utf8.txt]
^load[file in UTF-8 w/o BOM. UTF-8 charset is specified;247_utf8.txt;UTF-8]
^load[file in WINDOWS-1251. WINDOWS-1251 charset is specified;247_windows1251.txt;WINDOWS-1251]

@load[sTitle;sFile;sCharset][f]
<h3>$sTitle</h3>
$f[^file::load[text;$sFile;
	^if(def $sCharset){
		$.charset[$sCharset]
	}
]]

$f.text<br />

E-mail: