开发者

Troubles with PHP Encoding

I'm not PHP programmer but I need to change some things for CMS (opencart)

So that is not so hard I just found how it works Template -> Model -> View -> LanguageBase

But when I edit (with notepad) Language file like

<?php
// Heading
$_['heading_title']    = 'Информация'; // Changed russian word (it was russian, I just 开发者_C百科changed it to another word)
?>

And drop it on hosting, I can see ???????? Only :( How can I deal with encoding there ?

thank you.

Added : seems like files is truely UTF8, when I save it as ANSII I can see ���������


Can you scan your files for UTF8 BOM ? http://emrahgunduz.com/categories/development/php/take-2-on-utf8-bom-remove-bom-with-php/

Also use Notepad++ and save your files as UTF8 , don't use notepad.


Make sure you save the file as UTF-8. There's an "encoding" droplist in Notepad when you use "save as", it probably defaults to "Ansi". I'm assuming that your CMS is using UTF8, anything else would be surprising..


Make sure that your file is encoded in UTF-8 and that your server is sending the proper Content-Type header. You might also want to drop in the following in the head of your document:

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

You can send the proper header by using this snippet:

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

Also, if you are using FTP to upload your file, upload it in BINARY mode.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜