close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

UTF-8 in PowerGallery for different languages

Thread began 6/02/2010 10:41 pm by this_is_me | Last modified 6/29/2010 4:53 pm by Justin Nemeth | 2594 views | 8 replies |

this_is_me

UTF-8 in PowerGallery for different languages

power gallery seems to be no exception to this: Naming your pictures with "foreign" characters simply does not work as it should.
Although the php pages used in this collection are UTF-8 encoded, something seems wrong in the databes connections or collation. See below.

Power Gallery InstallationWizard shows:

* php5.3.2 is installed (screenshot363)
* GD Image Library [2.0]
* SimpleXML is installed
* Files and directories can be created
* btw: MySQL 5.1.41 is used

First thing which seemed unusual was the collation.
Checking the database tables with phpmyadmin shows collation latin1_bin. (screenshot357)
Then, go to admin and try naming your pictures. Like on the screenshots.
giving a title like
* "mon petit chien garçon" is changed to "mon petit chien gar?on"
* "señora" is changed to "se?ora" (screenshot 368),
* "große Liebe" turns to "gro� Liebe".

Any idea how to solve this?

Sign in to reply to this post

Justin Nemeth

Have you tried changing the collation of the table? In your last screenshot there is a dropdown with different values. Try changing it to one of the utf8 values and that will probably solve your issue.

Sign in to reply to this post

this_is_me

correctly saved now, but...

Thank you!
Your suggestion solved at least part of the problem.
I changed the collation to "utf8_bin" of "table pg1_gallery_images" (screenshot369) and corrected the description of image 9 from the picture samples to "mon petit chien garçon". This time it was saved correctly in the database. (screenshot370).

But the text in the category manage images (admin/manageimages.php) is displayed incorrect still. (screenshot372). It now shows "mon petit chien gar�on."
The page encoding shows utf-8, though.

So, no joy yet...

Sign in to reply to this post

Justin Nemeth

This is an old thread I found that might work another_lousy_php_mysql_charset_issue
They have a change that can be made to MySQL and one that can be made to PHP. I would try the PHP fix first, try setting the default_charset to utf8 and see if that fixes it. You can set that in the php.ini or by using ini_set('default_charset', 'utf8'); on the page itself (i'd put it in the global file since its on every page).

Sign in to reply to this post

this_is_me

I'll try that

thanks for the hint. I cannot try it from here but will do so asa I am back to my studio.
best

Sign in to reply to this post

this_is_me

php.ini

uncommenting php.ini's
default_charset = "utf-8"

did not change anything. :-(

was complicated enough to get this done at the webhost...

Sign in to reply to this post

this_is_me

What now?

The problem is not solved. I put
$result0 = mysql_query('SET NAMES utf8');
if (!$result0) {
die('invalid request: ' . mysql_error());
}
in the connection string for the mysql database but it still does not work. What part of the code is ruining the correct character transmission?

Sign in to reply to this post

this_is_me

finally solved

Originally Said By: Justin Nemeth
  This is an old thread I found that might work another_lousy_php_mysql_charset_issue
They have a change that can be made to MySQL and one that can be made to PHP. I would try the PHP fix first, try setting the default_charset to utf8 and see if that fixes it. You can set that in the php.ini or by using ini_set('default_charset', 'utf8'); on the page itself (i'd put it in the global file since its on every page).  



It took me some more grey hairs and some were pulled out, but I found the solution, thanks to your hint:
I put
//initial character set = utf-8
ini_set('default_charset', 'utf-8');

on top of the global.php file.
MIND THE DASH. I had to put utf-8. utf8 did not work!

Could you please advise your developers to be more consistent with the installation script, especially with the database settings. Had to manually replace all Latin1 collations with utf-8.
Now Señora Carmen is diplayed correctly

Sign in to reply to this post

Justin Nemeth

Awesome, glad you got it working and thanks for the follow up.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...