Advanced search  

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]

Pages: [1]   Go Down

Author Topic: Unicode UTF-8 Problems  (Read 911 times)

0 Members and 1 Guest are viewing this topic.

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 266
    • Adolfo Ventas - Naturaleza Andaluza
Unicode UTF-8 Problems
« on: August 07, 2022, 01:46:04 pm »

Hello friends, I have changed the server and I have solved a problem that I had with the php version of the server (I had to go down to 5.6). Now my website is working again but I have a UTF-8 encoding problem (before the change of the server it did not happen to me).

In some parts of Coppermine the characters do not come out correctly, an examples;

Word that should come out: Fotografía, Orquídeas, Rincón, Álbum
Word that comes out: Fotografía, Orquídeas, Rincón, álbum

I have checked with the Coppermine php files because the html of the index does not have this problem, but neither do some files that I have uploaded, for example:
https://www.adolfoventas.es/galeria/perfil.php

It also doesn't happen on any of the pages created with minicms.

What could be happening? I could change all the words, one at a time, but it's a very big job.

Thank you very much!
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1905
Re: Unicode UTF-8 Problems
« Reply #1 on: August 07, 2022, 06:16:12 pm »

It's a database coding issue.
Try adding:
Code: [Select]
$CONFIG['dbcharset'] = 'utf8';to your include/config.inc.php file.
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 266
    • Adolfo Ventas - Naturaleza Andaluza
Re: Unicode UTF-8 Problems
« Reply #2 on: August 12, 2022, 01:46:07 pm »

Ooohhh!, I think the problem has not been solved  :'( :'(. I have left it like this, I think it is correct, but the web continues to show some characters wrong  ::) :

Code: [Select]
<?php
// Coppermine configuration file

// MySQL configuration
$CONFIG['dbserver'] = '*******';        // Your databaseserver
$CONFIG['dbuser'] ='*********';        // Your mysql username
$CONFIG['dbpass'] = '********';        // Your mysql password
$CONFIG['dbname'] = '********';       // Your mysql database name
$CONFIG['dbcharset'] = 'utf8';             // Force Database to UNICODE UTF-8

// MySQL TABLE NAMES PREFIX
$CONFIG['TABLE_PREFIX'] =                '';
?>

The funny thing is that only some characters go wrong, other characters, which should also go wrong, go right.

Thanks for helping  :-*
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1905
Re: Unicode UTF-8 Problems
« Reply #3 on: August 12, 2022, 03:18:53 pm »

You might try removing the dbcharset value then (put // at the beginning of that line).

Only strings that are coming from the database are effected. The ones that you point out that are okay come from the language file(s), not from the database.
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 266
    • Adolfo Ventas - Naturaleza Andaluza
Re: Unicode UTF-8 Problems
« Reply #4 on: August 13, 2022, 06:52:41 pm »

You might try removing the dbcharset value then (put // at the beginning of that line).

Only strings that are coming from the database are effected. The ones that you point out that are okay come from the language file(s), not from the database.

Done. I have left it as it was before. There is no solution? If I update to CPG 1.6x, could the problem be solved?
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 266
    • Adolfo Ventas - Naturaleza Andaluza
Re: Unicode UTF-8 Problems
« Reply #5 on: August 16, 2022, 09:38:32 am »

Done. I have left it as it was before. There is no solution? If I update to CPG 1.6x, could the problem be solved?

I answer to myself;

Updating CPG from 1.5.48 to 1.6.19 has not solved the problem, I keep getting weird characters in some words. I also see these characters in the database.

Finally, I believe that there is no other solution than to correct every word in the entire gallery  :'( :'(.
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1905
Re: Unicode UTF-8 Problems
« Reply #6 on: August 16, 2022, 01:33:58 pm »

I'm sorry I can't give you exact detail but others have solved this without having to do what you suggest. If you search the forum well enough, you may find some tips for dealing with your situation. I think by using the right combination of dbcharset in the config file and table encoding values in the database, your problem could be solved.
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 266
    • Adolfo Ventas - Naturaleza Andaluza
Re: Unicode UTF-8 Problems
« Reply #7 on: August 22, 2022, 09:07:16 am »

I'm sorry I can't give you exact detail but others have solved this without having to do what you suggest. If you search the forum well enough, you may find some tips for dealing with your situation. I think by using the right combination of dbcharset in the config file and table encoding values in the database, your problem could be solved.

Thanks again ron4mac, you are always on the other side to help users :)

I will search better. I am now on CPG version 1.6.19 and the problem still exists. I don't have any experience in computer programming but I see that the errors also appear in the database (Screenshot attached).

I believe that CPG correctly shows what appears in the Database, it is not CPG's fault. It is possible that when making a backup copy of CPG in my previous hosting this problem appeared and the database has already been left wrong. If it were related, I'm afraid I no longer have access to the previous hosting.

Well, if I don't find a faster solution, I'll have no choice but to make the corrections directly in the database, with a lot of time (it's almost 1,000 entries).
Logged

ron4mac

  • Administrator
  • Coppermine addict
  • *****
  • Country: us
  • Offline Offline
  • Posts: 1905
Re: Unicode UTF-8 Problems
« Reply #8 on: August 22, 2022, 01:35:23 pm »

You should try:
Code: [Select]
$CONFIG['dbcharset'] = 'latin1';in your include/config.inc.php file.
Logged

KchoPrro

  • Coppermine frequent poster
  • ***
  • Country: es
  • Offline Offline
  • Gender: Male
  • Posts: 266
    • Adolfo Ventas - Naturaleza Andaluza
Re: Unicode UTF-8 Problems
« Reply #9 on: August 22, 2022, 06:00:15 pm »

You should try:
Code: [Select]
$CONFIG['dbcharset'] = 'latin1';in your include/config.inc.php file.

This does work! :)
My website is displayed correctly now, despite that, in the Database there are the strange characters (I attach two screenshots).

Logically, now what goes wrong are the words that I manually corrected, so it's not that they are wrong in the database, I suspect that they have to be like that and then the browsers must interpret those characters in Unicode UTF-8. For some reason this doesn't work, but latin1 does solve it.

Now I only have to undo the first 25 entries that I modified in the database manually.

Thanks a lot again ron4mac ;)
Logged
Pages: [1]   Go Up
 

Page created in 0.02 seconds with 21 queries.