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 5 of 5
  1. #1
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts

    string encoding problem

    I have a form with is submitting a string to a php page. the string is "oh ŭes"... as you can see the y has an accent on top of it... this is because the y is a diacritic. I want to change the ŭ back into a y but i can not seem to find a command to do it ...i tried this but it didnt work

    $thestring= str_replace('ŭ', "y", $thestring);

    but the result is still "oh ŭes".

    help

  • #2
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts
    It replaced it just fine for me. Are you maybe calling the same variable name twice somewhere?

    PHP Code:
    $string "oh ŭes";

    $thestring str_replace('ŭ''y'$string);

    echo 
    $string '</br>';
    echo 
    $thestring

  • #3
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    it also works fine when i do it that way ... but when i am submitting the string from a form on the previous page.. everything gets messed up.... on the previous the page has utf=á encoding.

  • #4
    Regular Coder
    Join Date
    Feb 2005
    Posts
    663
    Thanks
    5
    Thanked 14 Times in 14 Posts
    Can you post your form? Hard to help without seeing the code.

  • #5
    Regular Coder
    Join Date
    Nov 2008
    Posts
    165
    Thanks
    0
    Thanked 0 Times in 0 Posts
    It is just a simple form

    Code:
    <form name="form1" action="aftertestersignup.php">
    
    <input type="text" name="string" >
    
    </form>


  •  

    Posting Permissions

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