Advanced search  

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Pages: [1]   Go Down

Author Topic: Wrong Chars (Ä.Ü.Ö just on User Names  (Read 4733 times)

0 Members and 1 Guest are viewing this topic.

Thommy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Wrong Chars (Ä.Ü.Ö just on User Names
« on: May 03, 2017, 01:00:23 pm »

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
Logged

phill104

  • Administrator
  • Coppermine addict
  • *****
  • Country: gb
  • Offline Offline
  • Gender: Male
  • Posts: 4885
    • Windsurf.me
Re: Wrong Chars (Ä.Ü.Ö just on User Names
« Reply #1 on: May 03, 2017, 09:12:29 pm »

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

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Wrong Chars (Ä.Ü.Ö just on User Names
« Reply #2 on: May 04, 2017, 07:45:45 pm »

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:
Code: [Select]
$CONFIG['dbcharset'] =                      'utf8';          // Your mysql database charsetto 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...)

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

Thommy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Wrong Chars (Ä.Ü.Ö just on User Names
« Reply #3 on: May 04, 2017, 10:12:47 pm »

Hello and THX 4 Help

After Update to 1.5.46 (stable) and Change
Code: [Select]
$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
Logged

gmc

  • Dev Team member
  • Coppermine addict
  • ****
  • Country: us
  • Offline Offline
  • Gender: Male
  • Posts: 785
    • GMC Design Photo Gallery
Re: Wrong Chars (Ä.Ü.Ö just on User Names
« Reply #4 on: May 05, 2017, 07:27:26 pm »

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:
Code: [Select]
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.
Logged
Thanks!
Greg
My Coppermine Gallery
Need a web hosting account? See my gallery for an offer for CPG Forum users.
Send me money

Thommy

  • Coppermine novice
  • *
  • Offline Offline
  • Posts: 21
Re: Wrong Chars (Ä.Ü.Ö just on User Names
« Reply #5 on: May 05, 2017, 10:26:37 pm »

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
Logged
Pages: [1]   Go Up
 

Page created in 0.022 seconds with 20 queries.