473,395 Members | 1,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

110 100+
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
Expand|Select|Wrap|Line Numbers
  1.  " 
appearing in my pages where it should be human readable text.

you can see what I mean by going to http://www.hearwhere.com and search for a city like Paris. The second result down ('le comte de') shows
Expand|Select|Wrap|Line Numbers
  1. "
in the address.
If I html_entity_decode 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
Expand|Select|Wrap|Line Numbers
  1.  Ã©
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?
May 22 '08 #1
2 2454
dlite922
1,584 Expert 1GB
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
Expand|Select|Wrap|Line Numbers
  1.  " 
appearing in my pages where it should be human readable text.

you can see what I mean by going to http://www.hearwhere.com and search for a city like Paris. The second result down ('le comte de') shows
Expand|Select|Wrap|Line Numbers
  1. "
in the address.
If I html_entity_decode 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
Expand|Select|Wrap|Line Numbers
  1.  Ã©
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_escape_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
May 23 '08 #2
pedalpete
110 100+
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.
Expand|Select|Wrap|Line Numbers
  1. htmlentities($eventLoc, ENT_NOQUOTES, 'UTF-8');
  2.  
or is that the source of the problem? should I be using something else?
May 23 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Julie | last post by:
I have an html file where I display name,address,zip. It is one per line so it is basicall a list of addresses. But I would like ie6 to force the download prompt of this long list of names...
8
by: Profetas | last post by:
#define _GNU_SOURCE #include <stdio.h> #include <stdlib.h> void reverse(char *str); int main(void) { char *string; printf( "Enter a line of text:\n" );
12
by: comp.lang.php | last post by:
I have a textarea where people can cut & paste their resume. Unfortunately they often cut & paste their Word resume into the textarea, funky characters and all. This causes the display to be...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
6
by: Cerebral Believer | last post by:
Hi folks, I am having trouble identifying the error here can anyone help? Parse error: syntax error on line 318 $e-mail_1 = $_POST; Also will my use of " " (double quotes) instead of ' '...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.