NYCPHP Meetup

NYPHP.org

[nycphp-talk] UTF-8, databases and best practices

Rob Marscher rmarscher at beaffinitive.com
Wed May 23 16:23:42 EDT 2012


On May 23, 2012, at 3:32 PM, Hans Zaunere wrote:
> So obviously having output before doctype isn't what's supposed to happen,
> though it does, and when it does and Firefox suddenly makes double requests
> for no reason, it's really difficult to pin down.  Anyone else see anything
> like this?

I hadn't seen this, but there's a stackoverflow answer that verifies it:

http://stackoverflow.com/questions/1903925/firefox-makes-two-http-requests

From that page: "I've had a similar issue if the encoding of the page didn't match the <meta> tag. If the page was encoded using default windows encoding, but the meta tag specified UTF-8, then firefox would stop downloading once it reached a non-ascii character (e.g. æ,ø or å) and it would redownload the page from the beginning. This would mess up view counts and lots of other logic since the server side script would run twice."

Make sure your editor encoding is set to UTF-8.  A lot of them don't come with it set to UTF-8 out of the box.





More information about the talk mailing list