एन्कोडिंग
Unicode Escape
Unicode सीक्वेंस एन्कोडिंग और डिकोडिंग — कैरेक्टर्स को \uXXXX फ़ॉर्मेट में और वापस।
A Unicode escape sequence (\uXXXX) writes a character as its code point instead of the character itself — so a string literal in code can contain any Unicode character while the source file itself stays plain ASCII.
How to use it
- Encode: paste text and every non-ASCII character gets replaced with its matching \uXXXX sequence.
- Decode: paste a string containing \uXXXX sequences to get plain, readable text back.
- Characters outside the Basic Multilingual Plane (most emoji) are encoded as a surrogate pair of two sequences.
Common uses
- Reading JSON or JS code where non-ASCII text was pre-escaped into \uXXXX for compatibility.
- Inserting a character that's not on the keyboard into code via an explicit Unicode escape.
- Debugging why a string with an emoji shows up as two odd characters — recognizing a surrogate pair.
Things to keep in mind
\uXXXX encodes exactly one 16-bit UTF-16 unit, not one visible character — characters outside the Basic Multilingual Plane (most emoji) need two such sequences together (a surrogate pair).
JSON only requires escaping for control characters and a few special characters — escaping every character as \uXXXX isn't required, though it is valid.
इस टूल के बारे में लेख: Unicode Escape: \uXXXX अनुक्रमों का क्या मतलब है
अक्सर पूछे जाने वाले प्रश्न
\uXXXX फ़ॉर्मेट का मतलब क्या है?
यह किसी कैरेक्टर के यूनिकोड कोड पॉइंट को 4 हेक्साडेसिमल अंकों में दिखाता है, जैसे \u00e9 अक्षर é के लिए — यह JavaScript, JSON और कई और भाषाओं में इस्तेमाल होने वाला स्टैंडर्ड एस्केप फ़ॉर्मेट है।
इमोजी जैसे कैरेक्टर्स एन्कोड करने पर दो \u कोड क्यों दिखते हैं?
BMP से बाहर के कैरेक्टर्स (जैसे ज़्यादातर इमोजी) को एक \uXXXX से नहीं दिखाया जा सकता, इसलिए इन्हें UTF-16 सरोगेट पेयर के तौर पर दो जुड़े हुए \uXXXX कोड्स में एन्कोड किया जाता है।
क्या मेरा टेक्स्ट कहीं सर्वर पर भेजा जाता है?
नहीं, यह टूल पूरी तरह ब्राउज़र में काम करता है, कोई डेटा अपलोड नहीं होता।
सरोगेट पेयर को बीच में तोड़ दिया जाए तो क्या होगा?
नतीजा एक अमान्य "अनाथ" कैरेक्टर होगा — बिना जोड़ी वाला अकेला कोड। ज़्यादातर पार्सर या तो ऐसी स्ट्रिंग को एरर देकर अस्वीकार कर देंगे, या रिप्लेसमेंट कैरेक्टर "�" दिखाएँगे।
क्या इमोजी कैरेक्टर को एक ही \uXXXX से एन्कोड किया जा सकता है?
नहीं, अगर इमोजी बेसिक मल्टीलिंगुअल प्लेन से बाहर है (और आज के ज़्यादातर इमोजी ऐसे ही हैं) — इसके लिए हमेशा दो \uXXXX सीक्वेंस वाली सरोगेट पेयर चाहिए होती है।