Wrong encoding?

315 views
Skip to first unread message

redhead

unread,
Feb 10, 2012, 4:00:49 PM2/10/12
to NotORM
Hey Jakub,
I just replaced Nette\Database with NotORM and I ran into a problem,
where czech non-ASCI characters are rendered as question marks (?).

I looked on the internet and found only PDO setting on initialization
(SET NAMES), but no luck again. My documents are in correct encoding
(browser renders it in UTF-8 as well). Static data in templates are
rendered correctly, only data retrieved from NotORM are not.

Do you know what might the problem be?

Thanks for any advice.

Radek

redhead

unread,
Feb 10, 2012, 4:03:13 PM2/10/12
to NotORM
I forgot to mention that the db columns and tables are also set to
UTF-8 of course.

Hari K T

unread,
Feb 10, 2012, 9:14:17 PM2/10/12
to not...@googlegroups.com
Hi ,

May be this slide I have may help you 

http://www.slideshare.net/harikt/characterset

What to do is  

1 ) Setting DB and Table utf-8 general-ci or binary ( You have already set as you mentioned )
2 ) PDO connection : Set it as UTF-8 ( See in slide how to do it )
3 ) Set <meta http­equiv="Content­Type" content="text/html; charset=UTF­8" /> . This must be the first one after head .
4 ) Set characterset of apache as utf-8 in one means. For eg : AddDefaultCharset UTF­8 in .htaccess
5 ) In form accept­charset="utf­8"

Now try saving and editing a new one . Hope this helps you .

Radek Ježdík

unread,
Feb 11, 2012, 7:46:08 AM2/11/12
to not...@googlegroups.com
Oh this is a stupid mistake. I didn't check what code the Neon config file produces. Turned out that it can't handle static class constants, rendering PDO::MYSQL_ATTR_INIT_COMMAND as a string 'PDO::MYSQL_ATTR_INIT_COMMAND'.

Thanks for your time. I appreciate it.

This is the second time I'm asking about a problem, yet I didn't checked every little thing that may caused it. Sorry.

redhead

Dne 11.2.2012 3:14, Hari K T napsal(a):
Reply all
Reply to author
Forward
0 new messages