Tag Info

Hot answers tagged

15

It is referring to Response Headers and not document body ("Content-Type tag"). If you check Response Headers of your page with any HTTP Debugger (for example, Net panel of Firebug for Firefox, or similar tab of Developer Tools in Google Chrome/Internet Explorer/Safari/Opera), you will see this line: Content-Type: text/html At the same time, if you check ...


8

Those two final statements are big assumptions. For example, we have a web app that uses AJAX to its literal meaning - we use it for loading XML documents on the fly. If the XML document does not have the correct content-encoding header (or is lacking one at all), then any unicode characters (smartquotes, long dashes, even some special whitespace and the ...


8

With UTF-8 you have increased flexibility over ISO 8859-1. The former can encode any character included in Unicode while the latter is limited to Western European languages. ISO 8859-1 ("Latin1") doesn't include, for example, Greek, Hebrew, Arabic, Cyrillic, Chinese, Japanese and Korean, etc.


8

Use UTF-8, with proper fonts installed on the client, it universally represents all character sets of all the languages on the planet. Chinese, Cyrillic, Kanji, Arabic, Latin variants, etc. Find the Character Map tool in Windows 7 or its analog in Ubuntu 10+ and have a look at all of them in the various fonts. You can find different fonts are localized to ...


6

"Is there a common way to override the server headers send to the browser from within the HTML document?" AFAIK no, you do what you can do already. The defined charset via Header trumps your definition in the META tag. If you have access to the server, e.g. Apache, it is configured by this statement (see the comment lines): # Read the documentation before ...


5

This is absolutely worth doing, even for sites with average to low traffic levels. Although it will reduce your bandwidth (with a slight increase in CPU usage), the real benefit is to your users. Even on broadband you can notice a performance improvement when accessing compressed pages, but your users on slower network speeds and newer smartphones will ...


4

Alright, after some digging, here is what I have found (and it works). IndexOptions Charset=UTF-8 Cheers!


4

What @Fiasco_Labs said as far as which to use. For statistics: UTF-8 Growth on the Web at the W3C blog UTF-8 Usage Trends from BuiltWith


3

No, it's not possible from within the HTML. The servers response header take precedence over the document's meta-tag. As it's specified in 5.2.2 Specifying the character encoding - HTML 4.01 Specification : To sum up, conforming user agents must observe the following priorities when determining a document's character encoding (from highest priority to ...


3

You should set something like this in your root .htaccess <FilesMatch "\.(htm|html|xhtml|xml|php)$"> AddDefaultCharset utf-8 </FilesMatch>


3

UTF-8 can represent all languages supported by Unicode, all million+ characters. It uses one byte for ASCII characters (0-127), but up to 4 bytes for some international characters. UTF-16 also can also represent all Unicode characters. It uses exactly 2 bytes per character. I would recommend using UTF-8 exclusively. It has several advantages over ...


3

You're right, as long as you can ensure that you're using UTF-8 through and through, then you shouldn't need to escape anything but the XML entities that you mentioned (<, >, &). I think the reason you see people escaping other characters is because they've become a little "shell-shocked" by UTF-8 being converted into another encoding and having all ...


3

That's why those headers and attributes are there: to specify which character set the page uses. XML/XHTML documents should have it in the xml opening tag and HTML documents should have it in the meta tag. If the page has the proper encoding listed (and the file encoding actually matches) then the search engines should be smart enough to figure it out - ...


3

Changing the collation is what you want to do. Collations are rules regarding the sort order and search sensitivity. Every collation is based on a certain character set. There is no way to specify the character set separately from the collation.


2

Assuming you're dealing with the US, addresses are fairly public. The only real privacy concern is matching addresses to individuals -- and I don't think that an email address alone (at least, from what you've shared with us of your schema) is enough to present that risk. I work for SmartyStreets where we handle a lot of address data (standardizing, ...


2

As Osvaldo comments, it would be helpful to know just why you think you need to know this. When a user visits a web page, the browser will parse the page using whatever encoding the server tells it to use (via the HTTP Content-Type header or the corresponding HTML <meta> tag). The only time the browser default encoding matters is when the server ...


2

The best place for the character set declaration when served from your webserver is in the "Content-Type" header. You are doing it correctly when serving it from PHP. You could also set the header for CSS and JS. Assuming that your CSS and JS are not served through PHP, but as static files, you could add the following to your .htaccess file: ...


1

Will the browser cache these images? Well, what do you mean by caching in this context? Browsers cache static files so they don't have to request them again. If the image data is provided inline in the HTML page itself, no caching is required. If the image data is supplied in the stylesheet, then since the stylesheet itself will be cached, the image ...


1

From: http://allseeing-i.com/How-to-setup-your-PHP-site-to-use-UTF8 Unicode is not quite a first class citizen in PHP, so you'll have to do some tweaking to get it to grok UTF-8. Firstly, you need to ensure that you have MBString enabled in your copy of PHP. If you're on Linux and using a packaged PHP, it may be installed by default. If not, it's ...


1

UTF-8 is a transfer encoding that can represent all the 1,114,112 code points in Unicode (that is, all Unicode characters and also code points not assigned to characters). You may have been misled by the information that in UTF-8, a single code unit is 8 bits and has thus 256 possible values. But the representation of a character uses a variable number (one ...


1

The charset specified by web server in the HTTP header has priority. There are a few solutions to your problems: Tell web server to output different header for files in some directories (use AddCharset of AddDefaultCharset directives in the context) Convert all into UTF-8 and use only this charset Convert your UTF-8 encoded pages into iso-8859-1 using ...


1

As I understand it, the character encoding used by the browser is decided in the following order: The Content-Type response header as sent from the server. If not #1 then the Content-Type META tag. If neither of the above then the browser default, which I assume is based initially on the default language on the system. AFAIK the default encoding in the ...


1

Utf-8 and non English chars do not display well in iso-8859-1 and iso-8859-1 chars do not display well in utf-8. If you want to know the encoding your browser has detected and is using on a page: In Firefox just go to the menu "View" > "Character encoding". http://support.mozilla.com/en-US/kb/Menu%20Reference Make sure UF-8 is automatically selected ...


1

I would not encrypt any of that data from the application, which is what I expect you are talking about. Encrypting data like that slows things down and makes some tasks very difficult (like doing a query to search or sort on any of hat data). Instead I would look at encrypting at the database level. Let the DBMS handle the encryption so that your ...


1

Sorry, Metalshark, I couldn't provide a link. Thanks for trying to help though. A colleague found this question when he was searching for a solution as well. The solution in our case was fairly specific to a product we are using, but I will give the gist of it in case it helps anyone else looking in the future. The problem came down to MIME types and how we ...


1

We had the same problem with XML generated with Classic asp.. The workaround that worked best for us was to create a custom HTTP handler for XML files... Its something you can do in your web.config file: <handlers> <remove name="ASPClassic" /> <add name="XMLasASPClassic" path="*.xml" verb="GET,HEAD,POST" modules="IsapiModule" ...


1

To extend on Jason Birchs and Kinopikos answers: another increasingly important reason why you absolutely want to apply this (very simple) optimization is Googles announcement to use site speed in web search ranking as of April 09 2010. You surely don't wanna miss out on an improvement regarding your SEO efforts that easy ;) Once you start looking at things ...



Only top voted, non community-wiki answers of a minimum length are eligible