dongluanan7163 2016-10-11 20:47
浏览 42

Symfony2 - Utf-8 slu in in url

I have a test action in my Controller with a slug parameter.

/**
* @Route("/test/{re}")
*/ 
public function test(Request $request,$re) {
        return new Response("<html><head><meta charset='UTF-8'></head><body>".$re."</body></html>");
}

Although in Apache worked just fine with utf8 when i uploaded the whole project in iis the result appear like this : ��������. I know that the controller is in utf-8 because when i try to replace $re with a non latin word is appearing just fine. Any suggestions?? (Also the url in my browser is fine)

  • 写回答

1条回答 默认 最新

  • douti9286 2016-10-11 23:21
    关注

    The file's/script's or whole project's encoding may cause such problems. Check if that stuff is set to utf-8.

    评论

报告相同问题?

悬赏问题

  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源
  • ¥15 安卓JNI项目使用lua上的问题
  • ¥20 RL+GNN解决人员排班问题时梯度消失