special characters missing
<p>I have a list of camera names in a html table.  You can hit an edit button to edit the camera name if you wish.</p>

<p>This opens up a form (plus many other options) with the camera name now editable.  </p>

<pre><code>var edit = function(t, to, cameratype, cameraname, ...)
{
   var mydiv = js("#editform");

   if (mydiv.find("form").length) {
      mydiv.show();
   } else {
    // fields
    var $myform = js("&lt;form id='EditCameraForm' name='' method='post' action='" + to + "'&gt;&lt;/form&gt;");
    var $myfieldset = js("&lt;fieldset&gt;&lt;legend&gt;Edit camera settings&lt;/legend&gt;&lt;/fieldset&gt;");
    var $myinput = js("&lt;input type='hidden' name='camera_type' value='" + cameratype + "' /&gt;");
    var $mylabel = js("&lt;label for='CameraName'&gt;Camera name:&amp;nbsp;&lt;/label&gt;");
    var $myinput2 = js("&lt;input id='CameraName' name='camera_name' size='25' value='" + cameraname + "'  /&gt;");

    $myform.append($myinput, $mylabel, $myinput2, ...);
}
</code></pre>

<p>My problem is passing in cameraname.  I allow special characters.  So you can call the camera <code>Joe's camera</code>.</p>

<p>When I hit the edit button the camera name shows up as just <code>Joe</code>.</p>

<p>This has to do with my validation function in php when the camera name is first created...I believe:</p>

<pre><code>function check_input($data)
{
            $data = trim($data);
            $data = stripslashes($data);
            $data = mb_convert_encoding($data, 'UTF-8', 'UTF-8');
            $data = htmlentities($data, ENT_QUOTES, 'UTF-8');

            return $data;
 }
</code></pre>

<p>cameraname is passed in via the button click:</p>

<pre><code>&lt;button id="editbutton" onClick='edit(this, "&lt;?php echo htmlentities($_SERVER['REQUEST_URI']); ?&gt;", "&lt;?php echo $result_cameras[$i]["camera_type"]; ?&gt;", "&lt;?php echo $result_cameras[$i]["camera_name"]; ?&gt;", ...)'&gt;Edit&lt;/button&gt;
</code></pre>

<p>If you view the page source of this it will show: <code>Joe&amp;#039;s camera</code>.  So I thought maybe I have to decode this in the JS code with decodeURIComponent(cameraname) but that doesn't work.  Thanks for any help!</p>
