douying4909 2015-08-28 21:18
浏览 29

Codeigniter UTF-8在另一个视图中的加载视图中

I'm having a strange issue with loaded views in Codeigniter 3.0.1. I'm trying to display Spanish characters within my application. I have set these settings below to get Spanish displaying properly in the initial view loaded from my controller.

This is set in the main index.php of codeigniter.

header('Content-Type: text/html; charset=utf-8');

I also have set this on the top of my HTML page mark up.

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 

So Spanish characters in the main HTML page is displaying properly. The problem is when I try to load another view inside the main HTML file.

<html>
<body>

  spanish here //displays properly

  <?php $this->load->view("page/somepage"); //Spanish in view does not format properly ?>

</body>
</html>

Any Spanish characters loaded inside this view is not formatting properly. Anybody know a work around?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
    • ¥15 如何在scanpy上做差异基因和通路富集?
    • ¥20 关于#硬件工程#的问题,请各位专家解答!
    • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
    • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
    • ¥30 截图中的mathematics程序转换成matlab
    • ¥15 动力学代码报错,维度不匹配
    • ¥15 Power query添加列问题
    • ¥50 Kubernetes&Fission&Eleasticsearch
    • ¥15 報錯:Person is not mapped,如何解決?