mysql with text in different languages

Discussion in 'MySQL' started by aplus, Feb 6, 2007.

  1. #1
    Hello,
    I am developing an application where I need to store text from different languages western and eastern. I have used a standard collation of utf8_general_ci for the db and the tables, but this does not seem to work properly.
    I am using php and mysql 4.1

    Any help will be very appreciated.
     
    aplus, Feb 6, 2007 IP
  2. hape

    hape Peon

    Messages:
    108
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Are you using php for your application ?
    If so, change the following parts in php.ini
    default_charset = "none";
    For display use ISO code character set in the content type line of the web pages
    e.g. Western = ISO-8859-1, Chinese Big5 = big5, Traditional = gb2312, Japanese = Shift_jis
    Took me a pretty long time to figure this out but now my CMS works with Western languages as well as with Chinese, Korean, Japanese, Arabic ...
    Sincerely
    hape
     
    hape, Feb 11, 2007 IP
  3. aplus

    aplus Well-Known Member

    Messages:
    83
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    115
    #3
    Thanks for your reply :)
    I fixed the problem with a different method:

    I needed to execute the following commands before each query:

    
    	mysql_query("SET CHARACTER SET utf8", $link);
    	mysql_query("SET NAMES 'utf8'", $link); 
    
    PHP:
     
    aplus, Feb 12, 2007 IP