This is the Unicode character Start Of Text, code point U+0002 (decimal 2) in the Basic Latin block, added in Unicode 1.1. In HTML write , and in UTF-8 it is the single byte 02.
Codes
| Where | How to write it |
|---|---|
| Code point | U+0002 |
| Decimal | 2 |
| UTF-8 bytes | 02 |
| UTF-16 (big-endian) | 0002 |
| UTF-32 | 00000002 |
| HTML | not valid in HTML (a numeric reference to it is a parse error) |
| CSS | \2 |
| JavaScript | \u0002 |
| JSON | \u0002 |
| Python | \u0002 |
| Java, C# | \u0002 |
| Rust, Swift | \u{2} |
| Go, C, C++ | \u0002 |
| URL (percent-encoded) | %02 |
JavaScript and JSON strings store text as UTF-16, so this character is one code unit long. Python 3 strings count code points, so its length there is 1.
Properties
| Property | Value |
|---|---|
| Name | Start Of Text |
| Code point | U+0002 (decimal 2) |
| Block | Basic Latin (U+0000–U+007F) |
| General category | Cc: Control character |
| Script | Common |
| Bidirectional class | BN: Boundary neutral |
| Mirrored in right-to-left text | No |
| First in Unicode version | 1.1 |
Nearby in Basic Latin
- U+0000 Null
- U+0001 Start Of Heading
- U+0003 End Of Text
- U+0004 End Of Transmission
- U+0005 Enquiry
- U+0006 Acknowledge
- U+0007 Alert
- U+0008 Backspace
- U+0009 Character Tabulation
- U+000A Line Feed
All 128 characters: Basic Latin.
Official reference
Questions people ask
- What is the HTML code for Start Of Text?
- Use  (decimal) or  (hex).
- What is the UTF-8 encoding of U+0002?
- 02 (hex), 1 byte. In a URL it is %02.
- How do I write U+0002 in JavaScript or Python?
- JavaScript: \u0002. Python: \u0002.
Source
Unicode Character Database 18.0.0 (Unicode License v3); HTML entity names from the WHATWG HTML Standard (CC BY 4.0). The encodings above are computed from the code point and checked against Python's encoders. How the character looks depends on your fonts.
Legal entity
Devansh Yadav
Moradabad, Uttar Pradesh
Governing law: Courts at Moradabad, Uttar Pradesh
Phone: +91 8433475698
Legal: legal@analyzeit.in