html页面上的葡萄牙语重音错误

时间:2014-05-22 14:47:46

标签: php html powershell dojo

我的小网站上的葡萄牙语口音很大。 一个Html页面,它包含以下字段:

Name input type="text";

Date of departure input type="text" with a Dojo calendar; 

Cancel Phone Number: Yes / No input type="radio"; 

Cancel the data plate: Yes / No input type="radio"; 

Other: textarea. 

我得到了PHP中所有字段的值,当执行echo时,php文件中显示的数据是正确的。问题是当我创建file.txt时,还遇到了.html文件,但它没有转换重音符号。

因此,当我使用powershell脚本发送文件时,收到的电子邮件显示时没有重音符号,更正确地显示带重音符号的字母,请参阅问号(?)

- >我的php变量< -

$ name = $ _POST   ['name']; 
$ date = $ _POST ['fromDate_out']; 
$ tele = $ _POST ['phone']; 
$ board = $ _POST ['board']; 
$ other = $ _POST ['other']; 
$ OriginalDate = $ date; 
$ Newdate = date ("d-m-Y", strtotime ($ OriginalDate));

- >创建文件im .txt和.html< -

$ fp = fopen (" SaidaColaborador . html", "w +"); 
$ write = fwrite ($ fp, "
< ! DOCTYPE html > 
< html > 
< body > 
  < head > 
   </ head> 
Name: ------------------------------------- $ name 
< br > Date: --------------------------------- $ Newdate 
< br > Cancel  number: - $ tele 
< br > Cancel  data plate: -------------- $ plate 
< br > Other: -------------------------------- $ other 
< / body > 
< / html > 
" ) ; 

fclose ( $ fp ); 


/ * 
$ fp = fopen ( " SaidaColaborador . txt " , " w + " ); 
$ write = fwrite ($ fp, "
Name: ------------------------------------- $ name 
<br> Date: --------------------------------- $ Newdate 
<br>Cancel number: -- $ tele 
<br>Cancel data plate: -------------- $ plate 
<br> Other: -------------------------------- $ other 
");

fclose ($ fp); 
* /

- &GT;最后我的powershell脚本&lt; -

$ smtpServer = "my server" 
$ smtpTo = "receiver"
$ smtpTo2 = "receiver2"
$ smtpTo3 = "receiver3"
$ smtpFrom = "sender" 
$ messageSubject = "Saida_Colaborador"  

$ body = "<b> </b> <br>" 

$ file = 'C:\xampp\htdocs\SaidaColaboradorBCK03\FormColaboradorSaida\SaidaColaborador.html or .txt'
$ body + = Get - Content $ file 
send-MailMessage  -SmtpServer  $ smtpServer -To $ smtpTo3   -From $ smtpFrom  -Subject 
$ messageSubject   -Body  $ body  -BodyAsHtml  -Priority high 

- &GT;我希望做这样的事情&lt; -

Nome:DiogoáéÃúúúãããããç

数据:01-05-2014

Cancelarnúmerodetelefone:Não

Cancelar placa de dados:Não

Outros:olá,á,pé,mão

1 个答案:

答案 0 :(得分:0)

您需要使用utf8_encode功能设置编码,请检查http://www.php.net/manual/en/function.utf8-encode.php