short on details; the first thing i would check is the web page character encoding.

    The character encoding for a web page should be determined by the content-type header, which in php would be one of these to support lithuanian characters

    # I recommend using this one, since utf-8 can handle a lot more characters
    header('content-type: text/html; charset=utf-8');
    
    # This might however also be used, although you can no longer also support spanish etc
    header('content-type: text/html; charset=win-1257');
    

    UTF-8 supports a lot more characters, since it uses a variable byte length for its characters, from 1 to 3 bytes, whereas win-1257 uses one byte per character and thus have no room for more than special characters for one or a few languages. Sticking to utf-8 makes development painless in the long run if you ever have need for other special characters than those present in win-1257.

    However, not all browsers (yes, it's once again one or more browsers of the IE family) adhere to the content-type header like they should and instead go by the content-type meta element (which might even be deprecated). So, in the head element of your documents, also place

    <!-- used in HTML documents -->
    <meta http-equiv="content-type" value="text/html; charset=utf-8">
    
    <!-- used in XHTML documents -->
    <meta http-equiv="content-type" value="text/html; charset=utf-8" />
    

    The charset specified for the content-type meta element and the content-type header should of course be the same.

    Once that is done, you should also set your database to store stuff using the same character encoding. Or, if that's not possible, perform the proper conversion from the character encoding used for storage and the one used for display. In MySQL you'd do that by executing the command

    SET NAMES 'utf8'
    

    Or, if you use win-1257 in your web page, SET NAMES 'cp1257'. cp stands for Code Page, and what it does is specify what characters are encoded by bytes 128 to 255.

      Write a Reply...