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条)

报告相同问题?

悬赏问题

  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 关于大棚监测的pcb板设计
  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用