Re: Smart Quotes not so smart

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, November 21, 2006 9:19 am, Larry Garfield wrote:
> On Monday 20 November 2006 18:19, Richard Lynch wrote:
> However, I discovered that at least part of the problem is at the HTTP
> level.
> It seems like the data was being corrupted before it even got to the
> server.
> Although we already had the Content type charset set to UTF-8 in the
> HTTP
> header, the browser (IE, Firefox, and Konqueror) was still defaulting
> to
> Latin1/Western, and I believe then *sending* data as that.  When we
> set a
> <meta> tag to also set the content type and charset, however, the
> browser
> (all of them) switched into UTF-8 and submitted the data, and then
> displayed
> the smart quotes correctly (that is, without funky accented
> characters).  It
> only seemed to work if the browser was set to UTF-8 both to submit the
> data
> and to read it.  The existing pages remained borked.

Yes.

For some reason, IE, and now other browsers following suit, have
decided that Web Designers with their META tags are *much* more
reliable in their charset info than real HTTP headers from Web
Developers.

I do not claim to understand this rationale whatsoever, but there it is.

You still want the HTTP headers for older Firefox that actually
trusted them.

Without the META tag, IE actually uses a heuristic to "guess" at your
charset, rather than defaulting to Latin1.

I dunno what FF is thinking these days in regards to this...

> For the time being it seems the meta tag is working, but I'm quite
> curious as
> to why the browser would listen to that and NOT to the HTTP header.
> It also
> still doesn't explain why the string-replace method is still not
> working,
> even when everything is set to UTF-8.
>
> If anyone has an idea in that regard, please share. :-)

Once you have it as UTF-8, the "rules" for what is a character or
isn't may be too different for PHP 5 to handle?

That doesn't make sense, does it?...

I mean, it's still just one-byte characters at UTF-8, so you'd think
it would "just work"...

UTF-16, yeah, you'd have big problems, as they are 2-byte sequences to
define a char.

I barely understand this Unicode stuff, though, so maybe I'm missing
something...

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux