dqkf36241 2013-10-29 00:43
浏览 40
已采纳

处理西里尔语编码

I have a small problem, I'm using a .php page to show Russian characters. Now, I do this in two different ways. The text I take from the database shows fine, but if I show text like this

<h2>привет </h2> it doesn't show it at all. One thing worth mentioning is that I include my navigation file require_once "navigation.php" where I declare all the meta data etc.

So from navigation.php:

<meta charset="Cyrillic(Windows-1251)">

Solutions I've tried so far:

  • Adding encoding to .htaccess
  • Using php to output header encoding
  • Using Cyrillic(Windows-1251), UTF8, UTF16, iso-8859-5
  • Saving the file itself as UTF8

And I'm out of ideas. What I don't understand is how echoing the text from database works, but the HTML version doesn't.

  • 写回答

2条回答 默认 最新

  • douba1498 2013-11-04 01:06
    关注

    So the problem was somewhere in the JS. For this project, I was given complete HTML works, just to hook PHP to it. The HTML, among other things, had this:

    <script type="text/javascript" src="js/cufon-yui.js"></script>
    <script type="text/javascript" src="js/cufon-replace.js"></script>
    

    I have no idea what it does except it makes fonts smaller (why use JS for that is beyond me). So simple removal of that left me with a bit bigger font size, but working Cyrillic characters.

    <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算
  • ¥15 powerbuilder中的datawindow数据整合到新的DataWindow
  • ¥20 有人知道这种图怎么画吗?
  • ¥15 pyqt6如何引用qrc文件加载里面的的资源