Wrong Chars (Ä.Ü.Ö just on User Names Wrong Chars (Ä.Ü.Ö just on User Names
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Wrong Chars (Ä.Ü.Ö just on User Names

Started by Thommy, May 03, 2017, 01:00:23 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Thommy

Regards @all Supporters

Sorry for Query Post, but on German Support is (maybe Busy at the Moment) Nobody present.
(http://forum.coppermine-gallery.net/index.php/topic,79038.msg383144/topicseen.html#msg383144)

So I try to get Help this Way.

No here's my Prolem:

Coppermine Version 1.5.40 with Theme Dark Velvet from Markus is installed and Running.
I've a Second Database  with SQL Trigger to Copy from WebApp to Copermine for Insert New Users.
Charset of both Databases is utf8_unicode_ci and and also Header on Page is set to <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

All Chars on Gallery are shown correctly, ONLY User "special" Chars (Ä,Ü,Ö) are wrong

So set Name "Dörte" in SQL Database "user_name" is shown as "D�rte" in Online View.
ONLY Usernames are affected, Rest on Gallery are looking good.

Any Ideas what's the Problem there ?

Thank you and best Reagrads
Thomas

phill104

Could you upgrade to 1.5.46 first so you are running the latest version.
It is a mistake to think you can solve any major problems just with potatoes.

gmc

There is a config variable that can be specified in include/config.inc.php that will override the mysql charset in the event your installation doesn't seem to be recognizing it correctly.. (even though you say the DB is defined correctly - sometimes MySQL ends up with a wrong result... The variable was added to address this possibility.)

If you add:
$CONFIG['dbcharset'] =                      'utf8';          // Your mysql database charset
to include/config.inc.php - CPG will issue an explicit SET NAMES command to MySQL as part of establishing the connection.  See if this corrects your issue...

(It would typically show in other areas as well - IF you have used special characters in album titles, descriptions, etc...)

Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Thommy

Hello and THX 4 Help

After Update to 1.5.46 (stable) and Change

$CONFIG['dbcharset'] =                      'utf8';


All Usernames are shown correctly. But now ALL "special characters" in Gallery like the Description Text are wrong shown.

Ü is like ü
Ö is like ö

But (I'm wondering) Ä is looking correctly

Regards
Thomas

gmc

Then you have a mismatch of charsets in your data... It can be fixed, but there is some trial and error required.
I strongly suggest starting with a backup copy of your database.

This post indicates what is needed - the thread contains the detailed steps in how we arrived there:
http://forum.coppermine-gallery.net/index.php/topic,77017.msg373366.html#msg373366

Best suggestion I can give:
We know usernames displays properly when retrieved with charset utf8... Need to identify the charset that will properly display the remaining info... I'd suggest trying different values for the 'dbcharset' variable you added to see what works (of course usernames likely won't display properly)  I'd start with 'latin1' - and go from there...
A 'SHOW CHARACTER SET' command can be used to give you the valid choices.

The SQL command to correct EACH column (from the other thread) would be:
UPDATE tablename SET columnname= CONVERT(CAST(CONVERT(columnname USING charset) AS binary) USING utf8);
tablename, columnname, and charset need to be set appropriately...

Breaking that command up - inner CONVERT will read the data using the specified charset (whatever worked to properly display the data) - it then CASTs it as binary data - and then CONVERTs it to UTF8 - and assigns the value back to the original field - for the entire table - all in one statement.

The only rows that will show as updated are those with incorrectly translated data.
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Thommy

Hi GMC

Problem [SOLVED]  ;D
Changing ALL Tables from "utf8_unicode_ci" to "utf8 bin"
Just some Description Text I've overwrite "manually"
News Users are Correctly insert in DB also when taken "special characters" like Ä,Ü,Ö

THX a lot for Help
Best regards from Germany
Thomas