Are there charsets which doesn't have Space at Code 0x20?

0

Are there other charsets besides EBCDIC that doesn't have the Code 0x20 for a space? I saw some programs which has the space hardcoded as 32. Should I always use escape sequences for spaces or is hardcoding a valid option?

Buh13246

Posted 2019-04-29T13:14:25.737

Reputation: 38

32 is the decimal equivalent of 0x20, ie the same value. – AFH – 2019-04-29T13:26:05.333

This needs more context; what problem are you trying to solve? And what escape sequence would you use? – user1686 – 2019-04-29T13:36:21.640

It was a emacs Plugin so the escape seqence would be ?\s. But I try to find charsets used in computers nowadays which are not ascii conform. I just found that the EBCDIC charsets (Used on IBM Mainframes) has the value 0x40 for spaces. – Buh13246 – 2019-04-29T13:40:13.227

Answers

1

There are encodings where 0x40–0x5F do not necessarily have ASCII-compatible letters (e.g. Microsoft cp932), but they all preserve the meaning of 0x20. (Even JIS X 0208, where nothing starting with 0x21 is ASCII-like, still reserves 0x20 as space.)

The only notable exception is UTF-16 / UCS-2, which is a fixed-width multibyte encoding where space is encoded as 0x00 20, and a lone 0x20 may occur in any number of codepoints (e.g. Ƞ is U+0220 in Unicode, which is encoded as 0x02 20 in UTF-16).

Fortunately UTF-16 is already a special case because of 0x00, so it's very unlikely to be found in any place which needs to worry about 0x20 either.

user1686

Posted 2019-04-29T13:14:25.737

Reputation: 283 655

thanks this is what i was searching for. – Buh13246 – 2019-04-29T13:42:21.753