Example 1: Encode a value
Input (component variant, encodeURIComponent):
Müller & Söhne: 50% off?
Output:
M%C3%BCller%20%26%20S%C3%B6hne%3A%2050%25%20off%3F| Characters | Bytes | Result |
|---|---|---|
| ü | C3 BC | %C3%BC |
| Spaces | 20 | %20 |
| & | 26 | %26 |
| ö | C3 B6 | %C3%B6 |
| : | 3A | %3A |
| % | 25 | %25 |
| ? | 3F | %3F |
In words: 24 characters become 50 characters. 10 characters were replaced. The ü consists of two bytes and becomes %C3%BC, & becomes %26, and % itself becomes %25. Letters and digits remain unchanged.
