Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

charset attribute

What exactly does the following mean:
Quote:Specify the character encoding for the HTML document:


That's apparently what the charset attribute does, but I'm not entirely sure what that means and how it affects the document. Could anyone explain it to me?

Thanks
Add this to your html page:

Code
ћирилица

Save it without encoding, and preview it in the browser. Then add encoding and see the difference.

Simply, without encoding you will get some strange symbols, and when you add UTF-8 encoding for example, you would be able to see this cyrillic letters without problems.
(Aug 17, 2014 11:06 AM)theAbsolute Wrote:  Add this to your html page:

Code
ћирилица

Save it without encoding, and preview it in the browser. Then add encoding and see the difference.

Simply, without encoding you will get some strange symbols, and when you add UTF-8 encoding for example, you would be able to see this cyrillic letters without problems.

Oh okay, thanks. I still don't understand why we'd need to add that assuming our web pages weren't written in any strange language.
I can't be exact, but there are also some symbols, beside other letters. Probably, you don't have a need to put it if you are running some simple website.

But imagine if you have any kind of user system, or user comments, then you can always expect other letters then latin.
It can be contained in users names (notice strange nicknames on HF for example) user messages, etc.
Oh that makes sense, alright so it basically helps with other languages too right? In other words, it allows people to post in different languages without doing anything funky?
Yes, we can say so. Simply, it allows posting content on our websites in letters that isn't just latin.
(Aug 18, 2014 01:46 PM)theAbsolute Wrote:  Yes, we can say so. Simply, it allows posting content on our websites in letters that isn't just latin.

Thanks for your help.

+3 and closing.


Possibly Related Threads...
Thread / Author Replies Views Last Post
by klatzenMar 14, 2017 11:16 AM 5 261 Mar 14, 2017 11:16 AM
Last Post: klatzen
by Makaveli.Sep 7, 2016 05:58 AM 1 176 Sep 7, 2016 05:58 AM
Last Post: Sakuto
[Wordpress] by hamahemJun 29, 2016 08:52 PM 1 235 Jun 29, 2016 08:52 PM
Last Post: SIM-545076