ts2000abc Posted June 11, 2009 Share Posted June 11, 2009 When I try to save russian letters to database through my own UI (normal html form that is posted to php), mysql automatically converts these letter. Example: д converts to д I would like to save these russian/cyrillic letters as ”normal” text (not as converted special characters). When I use phpmyadmin to save russian letters straight into db everything goes just fine, letters are not converted (and they can be viewed ok). So I assume that there is something wrong with the my saving process... can anybody tell me how this situation is fixed. - Which database and table setting should I use? (now i use: CHARSET=utf8 COLLATE=utf8_unicode_ci) - Should I convert the input data somehow (php: iconv() for example)? - Should I use some special database connection setting when saving? (specify charset for example) Link to comment https://forums.phpfreaks.com/topic/161781-how-to-save-russiancyrillic-letter-properly-to-db/ Share on other sites More sharing options...
gizmola Posted June 11, 2009 Share Posted June 11, 2009 Well, it sounds like your webpage is not utilizing the UTF-8 characters set, but rather has fallen back to something like 8859-1. This is causing the site to convert input into html entities. Hence you are getting the html entity rather than the real utf-8 character stored in your database. You can test this quickly by setting the header: header('Content-Type:text/html; charset=UTF-8'); Does this fix the problem? Ultimately the default character set can also be set in the php.ini. Link to comment https://forums.phpfreaks.com/topic/161781-how-to-save-russiancyrillic-letter-properly-to-db/#findComment-853635 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.