Hi,
I'm using serendipity since a longer time. In the beginning I used MySQL 4.x and upgraded then to MySQL 5.x. The default charset was in the beginning "latin_swedish". Then I switched to UTF-8.
Here my MySQL variables:
character_set_client utf8
character_set_connection utf8
character_set_database utf8
character_set_filesystem binary
character_set_results utf8
character_set_server utf8
character_set_system utf8
character_sets_dir /usr/share/mysql/charsets/
collation_connection utf8_general_ci
collation_database utf8_general_ci
collation_server utf8_general_ci
That look correct. In serendipity I use UTF-8 for displaying chars too. So everything is right as it is...
But when I login via PhpMyAdmin to my database I see strange chars which replacing the umlauts. The word "über" is in the database stored as "über". But its displayed correctly when I view my blog in the browser.
So can anybody explain me what is wrong or what can I do to fix that?
Greets and best regards,
Dawn
Strange chars in DB
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: Strange chars in DB
Hi!
There's nothing wrong.
Did you check that your phpMyAdmin is using UTF-8 as connection charset?
When upgrading from MySQL 4 to 5, no native UTf-8 was created, but ISO-data simply now interpreted as UTF-8. So you can't actually change it easily so that it displays correctly in all environments, because s9y stores UTF-8 data in a ISO-8859-1 table for you. That's no problem, as long as proper charset connections are issued.
Best regards,
Garvin
There's nothing wrong.
Did you check that your phpMyAdmin is using UTF-8 as connection charset?
When upgrading from MySQL 4 to 5, no native UTf-8 was created, but ISO-data simply now interpreted as UTF-8. So you can't actually change it easily so that it displays correctly in all environments, because s9y stores UTF-8 data in a ISO-8859-1 table for you. That's no problem, as long as proper charset connections are issued.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
When I enter PMA it displays:
mysql charset: UTF-8 Unicode (utf8)
charset/ coalition of connection: utf8_unicode_ci
You said serendipity uses ISO-8859-1? When I look into serendipity_entries for example, it uses for all text and varchar fields as coalition utf8_unicode_ci.
Do I understand you in the right way that serendipity uses UTF8 but stores it in the table (UTF8 too) as ISO-8859-1 And there is no way to store the data in UTF8?
mysql charset: UTF-8 Unicode (utf8)
charset/ coalition of connection: utf8_unicode_ci
You said serendipity uses ISO-8859-1? When I look into serendipity_entries for example, it uses for all text and varchar fields as coalition utf8_unicode_ci.
Do I understand you in the right way that serendipity uses UTF8 but stores it in the table (UTF8 too) as ISO-8859-1 And there is no way to store the data in UTF8?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
s9y uses whatever you configure for storage. When you change it in s9y's config, it does not change older entries, the change will only affect string storage of new entries.
How s9y store entries also depends on if you enalbe the option "Use dbNames command" in s9y config. You can configure MySQL and s9y so that it store UTF-8 in UTF-8 tables, yes.
In your case, it could be that the command is not set and thus the UTF-8 is encoded in UTF-8 twice.
Regards,
Garvin
That looks right to me then.Dawn wrote:When I enter PMA it displays:
mysql charset: UTF-8 Unicode (utf8)
charset/ coalition of connection: utf8_unicode_ci
I only said so because I figured you installed s9y with ISO-support at first.You said serendipity uses ISO-8859-1? When I look into serendipity_entries for example, it uses for all text and varchar fields as coalition utf8_unicode_ci.
s9y uses whatever you configure for storage. When you change it in s9y's config, it does not change older entries, the change will only affect string storage of new entries.
How s9y store entries also depends on if you enalbe the option "Use dbNames command" in s9y config. You can configure MySQL and s9y so that it store UTF-8 in UTF-8 tables, yes.
In your case, it could be that the command is not set and thus the UTF-8 is encoded in UTF-8 twice.
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Ah, that's true, I forgot to mention that when you enable this option, you will get broken chars in the s9y output. But new entries you create like this should show up properly in phpMyAdmin.
What you CAN do is to enable the option, make a SQL dump via phpMyAdmin, use a tool to convert double UTF-8 encodings to UTF-8 single encodings (that might prove complicated) and then re-import the SQL dump.
But this is all so complicated that I would leave it at the current situation and live with "broken" chars within phpMyAdmin
Regards,
Garvin
Ah, that's true, I forgot to mention that when you enable this option, you will get broken chars in the s9y output. But new entries you create like this should show up properly in phpMyAdmin.
What you CAN do is to enable the option, make a SQL dump via phpMyAdmin, use a tool to convert double UTF-8 encodings to UTF-8 single encodings (that might prove complicated) and then re-import the SQL dump.
But this is all so complicated that I would leave it at the current situation and live with "broken" chars within phpMyAdmin
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Best regards,
Garvin
There's no tool for this, you need to use a proper Editor. VI, VIM can do that for you. I personally use UltraEdit for Windows to do character recoding.Dawn wrote:Can you suggest me a tool which can handle this?
Remember that you can break all of your data, if you don't have the expertise to perform the required operations...It is perhaps a little bit perfectionistic, but I want my data cleaned up and don't show only the right ouput....
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
I can't give preceise steps, because it very much depends on exact server settings, charset settings, mysql version, s9y entries, used browsed, used operating system.
But you need to make sure that after you upload the final SQL dump, all is in UTF-8 with UTF-8 collations, and no ISO-characters or double-UTF-8s remain.
Best regards,
Garvin
I can't give preceise steps, because it very much depends on exact server settings, charset settings, mysql version, s9y entries, used browsed, used operating system.
But you need to make sure that after you upload the final SQL dump, all is in UTF-8 with UTF-8 collations, and no ISO-characters or double-UTF-8s remain.
Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Hi!
Ah, okay. Double-UTF-8 encoding can'T be fixed by Ultraedit (or at least I didn'T know how to use it).
I wrote a php script that used file_get_contents, then used utf8_decode() once (or was it twice) and then re-saved the file. Sadly I don't have that small script no longer here
Regards,
Garvin
Ah, okay. Double-UTF-8 encoding can'T be fixed by Ultraedit (or at least I didn'T know how to use it).
I wrote a php script that used file_get_contents, then used utf8_decode() once (or was it twice) and then re-saved the file. Sadly I don't have that small script no longer here
Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/