html encoding and &quote; showing up in webpages instead of '

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pedalpete
    New Member
    • Oct 2007
    • 109

    html encoding and &quote; showing up in webpages instead of '

    Strange activity here,

    I was having some challenges with character encoding, and decided to just put html encoded characters in my DB, thinking they would be displayed properly when retrieved from the db.

    But now I have
    Code:
     "
    appearing in my pages where it should be human readable text.

    you can see what I mean by going to http://www.hearwhere.c om and search for a city like Paris. The second result down ('le comte de') shows
    Code:
    "
    in the address.
    If I html_entity_dec ode that line, i end up with a bunch of crazy black diamonds around question marks.
    And i even have one of those on the page further down at "Travis Barki' and then [code] ' [ /code] below that, and
    Code:
     é
    below that.

    I have no idea why I'm getting these kinds of values.
    My encoding is set to UTF-8 which seems to be right for 90% of the results. but these others are really annoying.

    Anybody know how I can resolve this?
    Looking in my database, it appears the data was entered as "

    is there a nice way of fixing something like this?
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    Originally posted by pedalpete
    Strange activity here,

    I was having some challenges with character encoding, and decided to just put html encoded characters in my DB, thinking they would be displayed properly when retrieved from the db.

    But now I have
    Code:
     "
    appearing in my pages where it should be human readable text.

    you can see what I mean by going to http://www.hearwhere.c om and search for a city like Paris. The second result down ('le comte de') shows
    Code:
    "
    in the address.
    If I html_entity_dec ode that line, i end up with a bunch of crazy black diamonds around question marks.
    And i even have one of those on the page further down at "Travis Barki' and then [code] ' [ /code] below that, and
    Code:
     é
    below that.

    I have no idea why I'm getting these kinds of values.
    My encoding is set to UTF-8 which seems to be right for 90% of the results. but these others are really annoying.

    Anybody know how I can resolve this?
    Looking in my database, it appears the data was entered as "

    is there a nice way of fixing something like this?

    or you chould just run mysql_real_esca pe_string() on your HTML and it will safely be entered into the database, no &quote; required.

    is that an option for you? if not, why not?

    Dan

    Comment

    • pedalpete
      New Member
      • Oct 2007
      • 109

      #3
      I tried that before, and i wasn't working.

      I had a thread here regarding that. now it seems my database is adding htmlencoded ' as &quot. even though i specify.
      Code:
      htmlentities($eventLoc, ENT_NOQUOTES, 'UTF-8');
      or is that the source of the problem? should I be using something else?

      Comment

      Working...