french characters using innerhtml and php

Posted on 2009-04-30
Last Modified: 2012-08-13
I have a php script, which displays records from the database. It has french characters also.
Now there is a textbox in front of each record, I can edit the order of each record and click on a save button. this calls an ajax function which replaces the whole div with the updated order of records.

Now the problem is that initially the records are displaying fine, but when the same thing is written after the ajax function is called using the innerhtml , then the french characters gets distorted and some squares are coming. also there is a radiobutton which opens a lightview window after replacing the div using innerhtml, the popup also does not come

hope i get an answer soon

thanks to all in advance !
<td><div align="center"><a href="add_news.php?nid=<?= $nrow->nid ;?>" class="lightview" title=":: :: autosize: true, width: 760, height: 630">

                <input type="radio" name="rdfid[]" id="rdfid[<?= $nrow->nid ;?>]"  />

              </a> </div></td>

              <? }?>


                  <?= htmlentities(stripslashes($nrow->title), ENT_QUOTES, 'UTF-8');?>


Open in new window

Question by:Desire2change
    LVL 14

    Expert Comment


    Use url_decode() function to display .

    For more about that:

    Author Comment

    i tried url_decode also but same output
    LVL 14

    Accepted Solution


    Make sure you have the following in your html: <meta http-equiv="content-type" content="text/html; charset=utf-8">

    And also you have


    in your php.ini.

    Please go through:

    Also check your apache.conf   for  default-character-set .

    Hope this will help you.


    Author Comment

    when i click on link say 'News', it shows me the titles correctly with the , then when i change order an ajax function replaces the titles with the changed order at that time the titles don't show correctly

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Someone recently asked me about how to display a progress indicator on a page while an iframe is loading. And I remember when I first came across this myself. It was a bit tricky to get my head around, but really, it's very simple. The most impor…
    Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
    This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now