1

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

4
  • Does it work fine on the same hosting before u edit? I doubt if the hosting supports the russian language? Commented Jun 19, 2011 at 18:09
  • @Roman: Hosting has nothing to do with it. Commented Jun 19, 2011 at 18:11
  • @Roman - yes my Edit braked the file somehow Commented Jun 19, 2011 at 18:11
  • 1
    Use Notepad++ to open and edit your file -- much safer. Using it open another file that has Russian words and check what encoding it uses (UTF-8 or Win-1251, with BOM or not). Now open problematic file and change to the same settings. Commented Jun 19, 2011 at 18:38

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes fixed, the BOM was a problem, converted files to UTF8 with no BOM.
2

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

5 Comments

Also if this file is included in some other file you may need to change those files to UTF-8 as well
I just tried to save it as UTF8 - same result. (and after all UTF8 were default chose)
Check that your servers defualt encoding (in php.ini) is utf-8. If you chose "view source" on the resulting web page, do you see some line in the header indicating utf8? <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> Is your text represented correctly in the source?
there is <?xml version="1.0" encoding="UTF-8"?> and I'm not sure where I can find php.ini (if I download and upload file with no changes it works fine)
upload a file with <?php phpinfo(); ?> in it and you'll find a row about default_encoding there somewhere. How about the files that use your data, are they all saved as utf8? I'm not familiar with opencart I'm afraid, so I don't know how it's built. If you upload a file with just "echo ('Информация');", how does that work?
1

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.

1 Comment

upload in binary mode did not helped and after all if I don't edit file just download and upload - it being fine :S

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.