Malayalam font not working

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ajaymohank
    New Member
    • Jan 2008
    • 29

    Malayalam font not working

    Hello friends.... my problem is that i have 2 dropdown in which the second drop down will get filled based on the value selected in the first drop down. the values in both dropdown are displayed in malayalam font. i am getting malayalam font in the first drop down, but not in the second one. value is coming in the second drop down but in a different format... some what like this.?\?\? . the value in the second drop down is done using ajax. i am submitting my ajax code here.

    i am using the malayalam font MLB-TTRevathi.

    please give a solution for this...

    [CODE=javascript]var xmlHttp;
    //var xmlHttp1;
    function GetXmlHttpObjec t()
    {
    xmlHttp=null;
    try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest( );
    }
    catch (e)
    {
    // Internet Explorer
    try
    {
    xmlHttp=new ActiveXObject(" Msxml2.XMLHTTP" );
    }
    catch (e)
    {
    xmlHttp=new ActiveXObject(" Microsoft.XMLHT TP");
    }
    }
    return xmlHttp;

    function pvfilltaluk()
    {
    //if(!checkfrm())
    //{
    //return false;
    //}

    if(document.get ElementById("rd 9").checked)
    {
    return false;
    }
    var xmlHttp=GetXmlH ttpObject()
    if (xmlHttp==null)
    {
    alert ("Your browser does not support AJAX!");
    return;
    }
    if (xmlHttp!= null)
    {
    var str="logicpvtal uk1.php?inputTe xt2="+document. getElementById( 'pvdst1').value +"&option="+ 5;
    xmlHttp.open("G ET",str, true);
    xmlHttp.onready statechange = setOutput2;
    xmlHttp.setRequ estHeader('Cont ent-Type','applicat ion/x-www-form-urlencoded');
    //xmlHttp.setRequ estHeader('char set','utf-8');
    xmlHttp.send(nu ll);
    }
    }

    function setOutput2()
    {
    if(xmlHttp.read yState==4)
    {
    //alert(xmlHttp.r esponseText);
    document.getEle mentById('pvdtl k').innerHTML=x mlHttp.response Text;
    }
    else
    {
    document.getEle mentById('pvdtl k').innerHTML="----loading---";
    }
    }
    }
    [/CODE]
    ............... ..............
    this is my php code for the dropdown 2.
    ............... ............... ...

    [PHP]<?
    ob_start();
    include "db_connect.php ";
    if($_REQUEST['option']==5)
    {
    $val =$_REQUEST['inputText2'];
    ?>
    <style type="text/css">
    <!--
    body,td,th {
    font-family: Times New Roman, Times, serif;
    font-size: 14px;
    font-weight: bold;
    }
    body {
    background-color: #D0F9D7;
    }
    .style1 {width: 164px}
    .myclass{font-family:MLB-TTRevathi;font-size:16px; color:#000000; width:164px;}
    .style3 {font-size: x-small}
    .style7 {color: #990000}
    .style8 {color: #0000FF}
    .style21 {font-size: 16px; color: #000000; width:164px; }
    -->
    </style>
    <select name="pvtaluk12 " id="pvtk1" class="myclass" >
    <option value="">Select Taluk</option>
    <?php
    $sql="select * from taluk where distcode='$val' order by talukcode";
    $rs=mssql_query ($sql,$link);
    while($row=mssq l_fetch_assoc($ rs))
    {
    $pvtkk=$row["talukcode"];
    $pvd=$row["distcode"];
    $pvta=$row["talukname"];
    ?>
    <option value="<? echo $pvtkk;?>"><? echo $pvta;?></option>
    <?
    }
    ?>
    </select>
    <?
    }
    ?>[/PHP]
    Last edited by gits; Jun 24 '08, 06:59 AM. Reason: added code tags
  • hsriat
    Recognized Expert Top Contributor
    • Jan 2008
    • 1653

    #2
    Seems to be problem with the char encoding.
    Do you have any test page?.

    Comment

    • ajaymohank
      New Member
      • Jan 2008
      • 29

      #3
      Originally posted by hsriat
      Seems to be problem with the char encoding.
      Do you have any test page?.
      hello hsriat..... i didnt get u. what do u mean by test page. if it is a char encoding problem, then how can i solve it.

      Comment

      • hsriat
        Recognized Expert Top Contributor
        • Jan 2008
        • 1653

        #4
        Originally posted by ajaymohank
        hello hsriat..... i didnt get u. what do u mean by test page. if it is a char encoding problem, then how can i solve it.
        Try this.[CODE=javascript]xmlHttp.setRequ estHeader("Cont ent-type", "applicatio n/x-www-form-urlencoded; charset:utf-8");[/CODE]

        By test page, I mean if you have put your page online just for testing purpose, then you can show that.

        Comment

        • ajaymohank
          New Member
          • Jan 2008
          • 29

          #5
          Originally posted by hsriat
          Try this.[CODE=javascript]xmlHttp.setRequ estHeader("Cont ent-type", "applicatio n/x-www-form-urlencoded; charset:utf-8");[/CODE]

          By test page, I mean if you have put your page online just for testing purpose, then you can show that.
          hello hsriat.... the code given by u is not woking

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            That should be "charset=ut f-8".

            Comment

            Working...