Post by Blackbird » Thu Feb 12, 2009 11:06 pm

Hi, I'm new with OpenCart, and using it on my local machine.

I'm using the right to left UTF-8 language. I translated the language files and my translated characters show without any problem but when I want to insert a text (using UTF-8 characters) for example in the fields of register, after submit my text become like this: "?? ?? ? ??". (text: أهلا وسهلا)

also when I changing a values directly in the DB, they show correctly.

read some of the topics about this problem but none of them helped me. also I noticed that Daniel said he fixed this problem in v1.1.2 but I still have this problem.

any help will be appreciated
thanks
Last edited by Blackbird on Thu Feb 12, 2009 11:12 pm, edited 1 time in total.

Newbie

Posts

Joined
Thu Feb 12, 2009 2:19 am

Post by Daniel » Thu Feb 12, 2009 11:49 pm

try removing the response->addHeader(); in the index.php.

Let me know the result please.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by Blackbird » Fri Feb 13, 2009 12:30 am

I removed this line in the index.php:

Code: Select all

$response->addHeader('Content-Type', 'text/html; charset=UTF-8');
and tested it again but nothing happened.

Newbie

Posts

Joined
Thu Feb 12, 2009 2:19 am

Post by Daniel » Fri Feb 13, 2009 12:44 am

I think it might be somthing to do with the html special character function in the request class. I'm going to do some testing tonight.

OpenCart®
Project Owner & Developer.


User avatar
Administrator

Posts

Joined
Fri Nov 03, 2006 6:57 pm

Post by jc » Fri Feb 13, 2009 12:04 pm

I had this problem too (http://forum.opencart.com/index.php/topic,3001.0.html).

Fix it by using language files in UTF8 without BOM (Byte Order Mark). BOM are 3 invisible characters in the head of UTF8 file which added by Windows Notepad. You can use Notepad++ or UltraEdit or any professional editor to save UTF8 without BOM.

jc
Newbie

Posts

Joined
Sun Feb 08, 2009 3:02 pm

Post by Blackbird » Fri Feb 13, 2009 4:47 pm

As I said in the first post, language files display correctly. my problem appears when I want to insert a text to the DB.

I'm using Dreamweaver CS3 and always saving the files without BOM.

Newbie

Posts

Joined
Thu Feb 12, 2009 2:19 am

Post by Blackbird » Sat Feb 14, 2009 4:50 am

OK, fixing this bug by changing the Collation of the opencart DB to "utf8_unicode_ci".

Go to: "phpmyadmin -> opencart DB -> Operations -> collation -> select: utf8_unicode_ci".

OR

Run this SQL query:
ALTER DATABASE `opencart_db_name` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci

Newbie

Posts

Joined
Thu Feb 12, 2009 2:19 am
Who is online

Users browsing this forum: No registered users and 7 guests