我有這個詞comЯade,但我不能打印在HTML因爲俄羅斯Я...我 嘗試:的Perl,接龍的Unicode寬字符在SYSWRITE在
$HTML::Entities::char2entity{'Я'} = 'Я';
$HTML::Entities::char2entity{'1071'} = 'Я';
$HTML::Entities::char2entity{'ï'} = 'Я';
$str = HTML::Entities::encode_entities($str, q{Яï1071});
,之後我想:
$str =~ s/1071/Я/g;
$str =~ s/Я/Я/g;
$str =~ s/ï/Я/g;
但在這兩種情況下,我得到這個錯誤:在
寬字符SYSWRITE在/ usr /本地/ share/perl/5.10.1/Starman/Server.pm line 470.
爲什麼?
某些代碼:
title.mi
<%init>
binmode STDOUT, ':encoding(UTF-8)';
($str =~ s/&/%26/g;); #this is working
$str =~ s/1071/Я/g;
$str =~ s/Я/Я/g;
$str =~ s/ï/Я/g;
</%init>
<div class="bd-headline left">
<h1 style="margin-top:0; padding-top:0;"> <% $str %> </h1>
</div>
base.mc
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
嘗試添加<%init> binmode STDOUT,':encoding(UTF-8)';%init>和
但仍然有相同的錯誤。我錯過了什麼? – mamesaye這就是我們想要的:破碎的代碼的任何樣本。 – ikegami
增加了一些代碼。感謝您的幫助 – mamesaye