w

Examples

Practical examples demonstrating various use cases for the Text Unicode Converter.

Basic Text Conversion

Simple ASCII Text

Convert basic English text to Unicode:

Input: Hello World!Output (Decimal): 72 101 108 108 111 32 87 111 114 108 100 33Output (Hex): U+0048 U+0065 U+006C U+006C U+006F U+0020 U+0057 U+006F U+0072 U+006C U+0064 U+0021Output (Unicode Escape): \u0048\u0065\u006C\u006C\u006F\u0020\u0057\u006F\u0072\u006C\u0064\u0021Output (HTML Entity): Hello World!

Numbers and Symbols

Convert numeric and symbolic text:

Input: 123!@#$%Output (Decimal): 49 50 51 33 64 35 36 37Output (Hex): U+0031 U+0032 U+0033 U+0021 U+0040 U+0023 U+0024 U+0025

International Text

Accented Characters

Convert text with accented characters:

Input: Café naïve résuméOutput (Decimal): 67 97 102 233 32 110 97 239 118 101 32 114 233 115 117 109 233Output (Hex): U+0043 U+0061 U+0066 U+00E9 U+0020 U+006E U+0061 U+00EF U+0076 U+0065 U+0020 U+0072 U+00E9 U+0073 U+0075 U+006D U+00E9

Non-Latin Scripts

Convert text in different scripts:

Greek: Γεια σας (Hello) Output (Hex): U+0393 U+03B5 U+03B9 U+03B1 U+0020 U+03C3 U+03B1 U+03C2

Cyrillic: Привет (Hello) Output (Hex): U+041F U+0440 U+0438 U+0432 U+0435 U+0442

Arabic: مرحبا (Hello) Output (Hex): U+0645 U+0631 U+062D U+0628 U+0627

Chinese: 你好世界 (Hello World) Output (Hex): U+4F60 U+597D U+4E16 U+754C

Emoji and Special Characters

Emoji Conversion

Convert emoji to Unicode:

Input: 😀🌍🚀💻Output (Decimal): 128512 127757 128640 128187Output (Hex): U+1F600 U+1F30D U+1F680 U+1F4BBOutput (Unicode Escape): \u{1F600}\u{1F30D}\u{1F680}\u{1F4BB}

Mathematical Symbols

Convert mathematical notation:

Input: ∑∏∫√∞±≤≥Output (Hex): U+2211 U+220F U+222B U+221A U+221E U+00B1 U+2264 U+2265

Currency Symbols

Convert currency symbols:

Input: $€£¥₹₽Output (Hex): U+0024 U+20AC U+00A3 U+00A5 U+20B9 U+20BD

Reverse Conversion Examples

Decimal to Text

Convert decimal Unicode codes back to text:

Input: 72 101 108 108 111Output: Hello

Input: 128512 127757Output: 😀🌍

Hexadecimal to Text

Convert hex Unicode codes to text:

Input: U+0048 U+0065 U+006C U+006C U+006FOutput: Hello

Input: U+1F600 U+1F30DOutput: 😀🌍

Unicode Escape to Text

Convert escape sequences to text:

Input: \u0048\u0065\u006C\u006C\u006FOutput: Hello

Input: \u{1F600}\u{1F30D}Output: 😀🌍

HTML Entity to Text

Convert HTML entities to text:

Input: HelloOutput: Hello

Input: 😀🌍Output: 😀🌍

Programming Use Cases

JavaScript String Literals

Generate JavaScript string literals:

Input: Hello "World"Output: \u0048\u0065\u006C\u006C\u006F\u0020\u0022\u0057\u006F\u0072\u006C\u0064\u0022

CSS Content Property

Generate CSS content values:

Input: Output: \2192

HTML Attributes

Generate HTML attribute values:

Input: "Hello"Output: "Hello"

JSON Escaping

Generate JSON-safe strings:

Input: Line 1\nLine 2Output: \u004C\u0069\u006E\u0065\u0020\u0031\u005C\u006E\u004C\u0069\u006E\u0065\u0020\u0032

Database and Storage

SQL String Literals

Generate SQL-safe strings:

Input: O'Brien's CaféOutput: \u004F\u0027\u0042\u0072\u0069\u0065\u006E\u0027\u0073\u0020\u0043\u0061\u0066\u00E9

XML Content

Generate XML-safe content:

Input: Price < $100Output: &#x50;&#x72;&#x69;&#x63;&#x65;&#x20;&#x3C;&#x20;&#x24;&#x31;&#x30;&#x30;

Web Development Examples

URL Encoding

Convert special characters for URLs:

Input: Hello World!Output: %48%65%6C%6C%6F%20%57%6F%72%6C%64%21

Base64 Encoding

Convert text for Base64 encoding:

Input: HelloOutput: 72 101 108 108 111 (decimal representation)

Regular Expressions

Generate regex patterns with Unicode:

Input: [a-z]Output: \u005B\u0061\u002D\u007A\u005D

Character Analysis

Character Count

Analyze character composition:

Input: Hello 世界!Character Analysis:

  • Total characters: 8
  • ASCII: 6 characters
  • Non-ASCII: 2 characters
  • Unicode blocks: Basic Latin, CJK Unified Ideographs

Unicode Block Distribution

Analyze Unicode block usage:

Input: Hello 世界 🌍Block Analysis:

  • Basic Latin: H, e, l, l, o, space
  • CJK Unified Ideographs: 世, 界
  • Emoticons: 🌍

Error Handling Examples

Invalid Unicode Codes

Handle invalid input gracefully:

Input: 999999 65 66Output: AB (invalid code 999999 is ignored)

Malformed Format

Handle format errors:

Input: U+0041 U+0042 U+ZZZZOutput: AB (invalid hex U+ZZZZ is ignored)

Mixed Formats

Handle mixed format input:

Input: 65 U+0042 67Output: ABC (when using decimal format, hex codes are ignored)

Performance Examples

Large Text Processing

Process large amounts of text:

Input: 1000 character Lorem Ipsum text Processing Time: < 10ms Memory Usage: Minimal increase

Batch Processing

Process multiple strings:

Input: Array of 100 strings, each 50 characters Processing Time: < 50ms Memory Usage: Linear with input size

Integration Examples

React Component

function UnicodeConverter() {
  const [text, setText] = useState('');
  const [format, setFormat] = useState('decimal');
  const [result, setResult] = useState('');

  useEffect(() => {
    if (text) {
      const converted = convertTextToUnicode(text, format);
      setResult(converted);
    }
  }, [text, format]);

  return (
    <div>
      <input value={text} onChange={(e) => setText(e.target.value)} />
      <select value={format} onChange={(e) => setFormat(e.target.value)}>
        <option value="decimal">Decimal</option>
        <option value="hex">Hexadecimal</option>
      </select>
      <div>{result}</div>
    </div>
  );
}

Node.js Script

const { convertTextToUnicode, convertUnicodeToText } = require('./unicode-converter');

// Convert text to Unicode
const text = 'Hello 世界';
const unicode = convertTextToUnicode(text, 'hex');
console.log(unicode); // U+0048 U+0065 U+006C U+006C U+006F U+0020 U+4E16 U+754C

// Convert Unicode back to text
const converted = convertUnicodeToText(unicode, 'hex');
console.log(converted); // Hello 世界
Was this page helpful?