A particular capital letter doesn't encode or decode properly?

Discussion in 'Programming' started by gandalf117, Oct 17, 2011.

  1. #1
    This is a really baffling problem!

    I just made a website that uses multiple languages and therefore the charset is UTF-8. I don't fully understand how character encoding works but usually it hardly creates a problem. Before I store text in a mysql database for a multilingual websites I execute the following little queries:

    $query1 = "set names 'utf8';";
    $query2 = "set character set 'utf8';";

    I believe that this tells the database that the text that is coming is foreign and should be encoded as utf-8. This is all I do and it usually works flawlessly.

    Now this particular website which contains texts in Cyrillic displays all the letters and text properly except the Cyrillic capital letter "I". It does that only on the server where the website is hosted but not on my home server where I have built and tested the website. I have used the same hosting company before and this has never happened. Even if I call them I am not sure what to tell them and if they will be able to help me, because it is all just so preposterous and baffling. It doesn't make sense. Capital letter "I" doesn't display properly in Cyrillic. This happens after the information has been submitted and stored in the database through the website and is queried for display.

    It seems absolutely illogical and ridiculous, because right now I have a ton of text on the website and everywhere that particular capital letter is displayed like this: �?
    Everything else displays properly. I really really want to know what may cause such a mistake?

    Does anyone have an idea?
     
    gandalf117, Oct 17, 2011 IP
  2. gtownfunk

    gtownfunk Member

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    41
    #2
    It must be getting lost somewhere along the way, I would suggest debugging the entire process.. looking for that exact character, and just stepping through the entire procedure. Does it display properly when you visit the original website? If so, then it won't be impossible to fix :). It just sometimes takes some time to figure out where the problem is occurring.

    Ben
     
    gtownfunk, Oct 18, 2011 IP
  3. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #3
    Make sure that the collation for the database itself is UTF8 (probably unicode would be best if you need multi-language support).
     
    Rukbat, Oct 21, 2011 IP