Results 1 to 6 of 6

Thread: Strange characters...

  1. #1
    Join Date
    Jan 2007
    Location
    Charlotte, NC
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Strange characters...

    So I've built an program that takes some text and inserts that into a MySQL database with htmlentities and addslashes so it gets inserted no problem. However when it is read from the database with html_entity_decode a bunch of strange characters get displayed.

    http://www.ja-miller.com/test/

    Anybody have any ideas?

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Well, form what I see all you have are `?` replacing thinks like maybe some odd weird character('¿'). Or maybe its not odd its just a simple single quote('). But I think it depends on what kinda field you have in your collation[I think thats what its called].

    I hope this helps.
    Nile
    Jeremy | jfein.net

  3. #3
    Join Date
    Jan 2007
    Location
    Charlotte, NC
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Not completely sure what you were trying to say there... But, I changed the collation to several different types (from the default of latin1_swedish_ci) and no luck.

    From looking at the source, something is happening with non breaking spaces (&nbsp. However it makes absolutely no sense to me why this would be happening...

    Thanks for trying tho!

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    use character encoding, and set it to UTF-8

  5. #5
    Join Date
    Jan 2007
    Location
    Charlotte, NC
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the response as always boogy! But how do I "use character encoding?" I did some googling and found out how to change it in php.ini. So I un-commented out the line, changed it from the default iso-something to UTF-8, and restarted the services but that didn't change anything.

    Thanks

  6. #6
    Join Date
    Jan 2007
    Location
    Charlotte, NC
    Posts
    82
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Default

    :P

    Fixed it!! Explicitly telling the html_entity_decode function to expect UTF-8 worked perfectly!

    Thanks again!

Bookmarks

Posting Permissions

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