Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Russian Characters

    If I type Russian characters into a form field it for some reason converts into gibberish!? Please help. I am using Windows XP Professional. Is my configurations wrong?

    Test:


  • #2
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is this on your website, or someone else's?
    Quet Storm Designs ~ Art is not what you see, but what you make others see.
    the Storms || Ultraviolent Winter || Was Einstein Wrong? || Its About Time!

  • #3
    New Coder
    Join Date
    Jul 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well, it's important because I have a database and I want to insert foreign characters into it from the form fields. (PHP + MySQL)

    Do you see Russian characters (something like Pycckuu) or gibberish (something like Donneee) in my post above below the word "Test:".

  • #4
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Try putting this on the pages you need the characters:


    <HTML>
    <HEAD>


    <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=koi8-r">


    </HEAD>
    Quet Storm Designs ~ Art is not what you see, but what you make others see.
    the Storms || Ultraviolent Winter || Was Einstein Wrong? || Its About Time!

  • #5
    New Coder
    Join Date
    Jul 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks a lot! That worked. Suppose I wanted to have a multidude of languages though. What should I do then?

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Beyond Lament
    Posts
    424
    Thanks
    0
    Thanked 0 Times in 0 Posts
    original script

    Maybe you could do something like this?:
    Code:
    
    <HTML>
    <HEAD>
    
    <SCRIPT LANGUAGE="JavaScript">
    <!--//
    var type=navigator.appName
    if (type=="Netscape")
    var lang = navigator.language
    else
    var lang = navigator.userLanguage
    var lang = lang.substr(0,2)
    
    // english
    if (lang == "en")
    document.write('<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <META HTTP-EQUIV="Content-language" CONTENT="en">')
    
    // russian
    else if (lang == "ru")
    document.write('<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=koi8-r">
    <META HTTP-EQUIV="Content-language" CONTENT="ru">')
    
    // french 
    else if (lang == "fr")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-1">
    <META HTTP-EQUIV="Content-language" CONTENT="fr">')
    
    // german 
    else if (lang == "de")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-1">
    <META HTTP-EQUIV="Content-language" CONTENT="de">')
    
    // greek 
    else if (lang == "el")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-7">
    <META HTTP-EQUIV="Content-language" CONTENT="el">')
    
    // hebrew 
    else if (lang == "iw")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-8859-8">
    <META HTTP-EQUIV="Content-language" CONTENT="iw">')
    
    // chinese 
    else if (lang == "zh")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=hz-gb-2312">
    <META HTTP-EQUIV="Content-language" CONTENT="zh">')
    
    // korean 
    else if (lang == "ko")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=ksc_5601">
    <META HTTP-EQUIV="Content-language" CONTENT="ko">')
    
    // japanese 
    else if (lang == "ja")
    document.write('<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=iso-2022-jp">
    <META HTTP-EQUIV="Content-language" CONTENT="ja">')
    
    // if none of above (default to English or any other)
    else
    document.write('<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1">
    <META HTTP-EQUIV="Content-language" CONTENT="en">')
    
    //-->
    </SCRIPT>
    
    
    </HEAD>
    
    Depending on what your visitors' browser language is set to, it will display the characters correctly. If you have your browser set for english, and try to type in , it will show up as 'gibberish' again.

    *Just found this:
    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    Try putting just that on your site and see if that works first - before putting up all that JavaScript.
    Last edited by Quiet Storm; 09-06-2002 at 05:07 PM.
    Quet Storm Designs ~ Art is not what you see, but what you make others see.
    the Storms || Ultraviolent Winter || Was Einstein Wrong? || Its About Time!

  • #7
    New Coder
    Join Date
    Jul 2002
    Posts
    19
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmm, actually, I want to be able to display characters from multiple languages simultaneously.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •