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

    Getting special characters to work in form fields?

    //When just using a textarea, I'm not setting a value, so alls good...
    $details = stripslashes($row[details]);

    //When set via value, I get an accented  before a Registered Trademark symbol.
    $blurb = "value=\"" . stripslashes($row[blurb]) . "\"";

    How do you get special characters to stop generating all sorts of crazy stuff when being set to input fields?

    <p><label for=\"description\">Description<small>(HTML Enabled)</small>: </label><textarea cols=\"45\" rows=\"8\" name=\"details\">$details</textarea></p>
    <p><label for=\"blurb\">Blurb<small>(Example)</small>: </label> <input type=\"text\" name=\"blurb\" size=\"40\" maxlength=\"64\" $blurb /></p>
    Last edited by iceflyin; 09-06-2007 at 12:26 AM.

  • #2
    Senior Coder
    Join Date
    Jan 2007
    Thanked 58 Times in 54 Posts
    Check your character encoding (UTF-8 vs. ???) because usually those characters are generated by improperly using text from a different encoding. Such as using substr() on a multibyte string (UTF-8, etc.). Substr() doesn't know that some characters are composed of 2 bytes, so they treat it as a normal character, which is why you see the odd A.


    Posting Permissions

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