Dathremar Posted February 19, 2008 Share Posted February 19, 2008 Maybe the topic isn't clear enough about my problem but i didn't know how to phrase it.... So I will try to be as much informative as i can. The thing is that i want to insert into a languages table the id (which is a short name of the language , in my matter it is BG - Bulgarian) the name of the language (Bulgarian but with utf8 encoding which means the display of it to be on bulgarian font) .... The php code that some one made before me (and works fine for ut8 - macedonian language) is: name = 'Ìàêåäîíñêè'; --> Here is my problem, need to write the Bulgarian word here in this kind of writing ????? so it would be inserted correctly in MySql $name = convert_charset("$name", "windows-1251", "UTF-8"); --> this is function that calls the iconv lib function from php $string = "UPDATE languages SET name = '$name' WHERE language_id = 'MK'"; $db_chat->query($string); Dunno if i am clear enough , so if you need some more info please ask. thanks in advance Quote Link to comment Share on other sites More sharing options...
effigy Posted February 19, 2008 Share Posted February 19, 2008 Will this be coming from user input? Quote Link to comment Share on other sites More sharing options...
aschk Posted February 19, 2008 Share Posted February 19, 2008 Your Charset in MySQL needs to be binary (not latin1 or whatever). Quote Link to comment Share on other sites More sharing options...
effigy Posted February 19, 2008 Share Posted February 19, 2008 Your Charset in MySQL needs to be binary (not latin1 or whatever). "Binary" is not a character set--can you clarify? Quote Link to comment Share on other sites More sharing options...
Dathremar Posted February 20, 2008 Author Share Posted February 20, 2008 Your Charset in MySQL needs to be binary (not latin1 or whatever). "Binary" is not a character set--can you clarify? Ok, I checked the table settings and the Character set is ISO 8859-1 Western Europe, as far as I can see the input is made manually into the variable $name (this is a page for testing the language and inserting information about the language) and when you load the page it does the insertion. So after I input here the text in the variable (dunno how to use that kind of chars) this code inserts it into the languages table. Quote Link to comment Share on other sites More sharing options...
effigy Posted February 20, 2008 Share Posted February 20, 2008 I would convert everything to UTF-8: the meta tag, the string, and the table. Quote Link to comment Share on other sites More sharing options...
aschk Posted February 20, 2008 Share Posted February 20, 2008 binary IS a Charset for MySQL, check the documentation http://dev.mysql.com/doc/refman/5.0/en/charset-charsets.html but theoritcally UTF-8 should suffice for this. Quote Link to comment Share on other sites More sharing options...
effigy Posted February 20, 2008 Share Posted February 20, 2008 A "pseudo charset"--interesting, to say the least. Why would any one actually use this? For a table that stores images? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.