Share » Forums » Developer » Help with UTF8 and eZDB:instance ...

Help with UTF8 and eZDB:instance problem needed

Help with UTF8 and eZDB:instance problem needed

Wednesday 13 February 2008 9:54:19 am - 3 replies

Author Message

Björn Dieding@xrow.de

Wednesday 13 February 2008 2:29:26 pm

try

var_dump( $ResultArray );

or

$out .= $ResultArray[0]['language'];

Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs
Looking for hosting? http://hostingezpublish.com
-----------------------------------------------------------------------------
GMT +01:00 Hannover, Germany
Web: http://www.xrow.com/

Piotrek Karaś

Wednesday 13 February 2008 9:54:02 pm

There's too little context, but that's looks like invalid connection encoding was used to input the data or is skipped when connecting. Normally, before you work with UTF8 DB, you should call 'SET NAMES utf8' query (this is done automatically by eZ Publish db libs, I believe). When you establish your own connection and send query, it's most probably latin encoding by default, which is why your data seems fine.

Hint: use PHPMyAdmin, choose any UTF-8-like language and utf8_general_ci collation (just in case) and look at the data.

PS. Also, not sure if those references are needed there...

Good luck!

--
Company: mediaSELF Sp. z o.o., http://www.mediaself.pl
eZ references: http://ez.no/partners/worldwide_partners/mediaself
eZ certified developer: http://ez.no/certification/verify/272585
eZ blog: http://ez.ryba.eu

Kristof Coomans

Wednesday 13 February 2008 11:21:09 pm

When using eZDB::instance(), there should be no need anymore to do a "SET NAMES ..." because it's done by the mysql database plugin IF your eZ Publish site is correctly configured (in i18n.ini, [CharacterSettings] Charset=utf-8 and in site.ini [DatabaseSettings] Charset= ). In case you're using mysqli, there's a special function used to set the connection's character set: mysqli_set_charset(...). But in either way, it should be automatically done for you when using eZDB::instance().

independent eZ Publish developer and service provider | http://blog.coomanskristof.be | http://ezpedia.org

You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu