Hi,
I`m making a bulgarian language site and when a user submit text in a form with bulgarian characters to the database it shows in hieroglyphics.
When I echo the submitted text from the form - there are no problems - everything is shown correctly on the page.
Only the databases are problematic...
Im using meta tag with charset "windows-1251".
Any suggestions what to do about that?
Strange hieroglyphics show when insert values in a MySql DB
Moderator: General Moderators
-
waqas_punjabian
- Forum Commoner
- Posts: 67
- Joined: Wed Aug 10, 2005 9:53 am
Re: Strange hieroglyphics show when insert values in a MySql DB
What is the Collation of your databse tables and the field where you are saving those characters?
I think you should use "utf8_unicode_ci" for both of them. This will allow you to enter characters based on Unicode. (I suppose Bulgarian language characters are supported in UTF8) try it though.
I think you should use "utf8_unicode_ci" for both of them. This will allow you to enter characters based on Unicode. (I suppose Bulgarian language characters are supported in UTF8) try it though.
Re: Strange hieroglyphics show when insert values in a MySql DB
That's in the HTML you generate, but your database probably contains/outputs something else.psicloone wrote:Im using meta tag with charset "windows-1251".
Using ansi, even if you use it everywhere consistently, is really asking for problems sooner or later. For example, what happens if someone who was born in Sweden but now lives in Bulgaria and uses your site, and wants to fill in his name "Ånders Gustävsøn"? Can't express that in windows-1251 ansi.
Just use utf-8 everywhere (using utf8_unicode_ci collation for the SQL part) and you'll be safe.
Re: Strange hieroglyphics show when insert values in a MySql DB
Certainly, Bulgarian uses Cyrillic characters, just like Russian and several other East-European languages.waqas_punjabian wrote:(I suppose Bulgarian language characters are supported in UTF8)
Utf-8 is just an encoding for unicode, and unicode supports pretty much all reasonable characters used on planet earth (including Klingon
Re: Strange hieroglyphics show when insert values in a MySql DB
++Apollo wrote:Just use utf-8 everywhere (using utf8_unicode_ci collation for the SQL part) and you'll be safe.
Don't use cp-1251
There are 10 types of people in this world, those who understand binary and those who don't
Re: Strange hieroglyphics show when insert values in a MySql DB
Thanks for the help!
I used windows-1251 as meta tag, also my notepad was wrongly encoded, and the colation should had been utf8...
I used windows-1251 as meta tag, also my notepad was wrongly encoded, and the colation should had been utf8...