cnd
cnd

Reputation: 33714

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 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 ���������

Upvotes: 1

Views: 136

Answers (3)

Eray
Eray

Reputation: 7128

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.

Upvotes: 2

Andrew Moore
Andrew Moore

Reputation: 95314

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.

Upvotes: 1

Bing
Bing

Reputation: 746

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..

Upvotes: 2

Related Questions