Charset in HTML

HTML Encoding (Character Sets)

Charset in HTML ka matlab hai wo character encoding system jo browser ko batata hai ki web page par text aur symbols kaise display karne hain. Agar HTML Charset correctly define na ho, to kuch characters browser me galat ya broken dikh sakte hain.

Isi liye HTML charset ko define karna important hota hai taaki browser page ke characters ko sahi tarah read kar sake.


HTML Charset Attribute

HTML page ko browser me sahi tarah display karne ke liye browser ko pata hona chahiye ki kaunsa HTML charset use ho raha hai. Ye character set <meta> tag me define kiya jata hai.

Example:

Charset in HTML

Ye line browser ko batati hai ki page UTF-8 character set use kar raha hai. Modern web development me charset in HTML ke liye UTF-8 use karna recommended hai.

HTML specification bhi web developers ko suggest karta hai ki charset in HTML ke liye UTF-8 use karein, kyunki UTF-8 duniya ke almost saare characters aur symbols ko support karta hai.


Types of Charset in HTML

Web development me time ke saath different HTML Charset use kiye gaye hain.


ASCII Character Set

ASCII web ka sabse pehla character encoding standard tha aur early charset in HTML systems me use hota tha.

Isme total 128 characters define kiye gaye the jo internet par use ho sakte the:

  • English letters (a–z aur A–Z)

  • Numbers (0–9)

  • Kuch special characters jaise:
    ! $ + - ( ) @ < > . # ?

ASCII simple aur fast tha, lekin ye limited characters support karta tha. Isi wajah se advanced charset in HTML systems ki zarurat padi.


ANSI Character Set (Windows-1252)

ANSI Windows ka pehla character set tha jo ASCII se thoda advanced tha. Ye bhi ek type ka charset in HTML maana jata hai.

Iski khas baatein:

  • Pehle 127 characters ASCII jaise hi the

  • 128 se 159 tak special characters add kiye gaye

  • 160 se 255 tak UTF-8 jaise hi characters the

Isko HTML me define karne ke liye:

ANSI Character Set (Windows-1252)

ISO-8859-1 Character Set

HTML 4 ka default charset in HTML ISO-8859-1 tha. Isme total 256 characters supported the.

Features:

  • Pehle 127 characters ASCII jaise hi

  • 128 se 159 ke characters use nahi karta

  • 160 se 255 tak ANSI aur UTF-8 jaise hi characters

HTML 4 me ise aise define kiya jata tha:

ISO-8859-1 Character Set

UTF-8 Character Set

UTF-8 aaj ka sabse powerful aur recommended charset in HTML hai.

Iski khas baatein:

  • 0 se 127 tak ASCII jaise hi

  • 128 se 159 ke characters use nahi karta

  • 160 se 255 tak ANSI aur ISO-8859-1 jaise hi

  • 256 ke baad continue karta hai aur 10,000+ characters support karta hai

UTF-8 duniya ke almost saare languages, symbols aur emojis ko support karta hai. Isi wajah se modern web development me charset in HTML ke liye UTF-8 sabse best choice mana jata hai.

Isko define karne ke liye:

HTML Charset Attribute

HTML Charset browser ko ye batata hai ki web page ke characters kaise display hone chahiye. Pehle ASCII, ANSI aur ISO-8859-1 jaise character sets use hote the, lekin aaj modern websites me charset in HTML ke liye UTF-8 sabse recommended aur widely used encoding hai.

Leave a Comment