Are digits represented in sequence in all text encodings?

后端 未结 5 1822
甜味超标
甜味超标 2020-12-21 17:05

This question is language agnostic but is inspired by these c/c++ questions.

How to convert a single char into an int

Char to int conversion in C

Is

5条回答
  •  离开以前
    2020-12-21 17:44

    I don't know about all encodings, but at least in ASCII and EBCDIC, the digits 0-9 all come consecutively and in increasing numeric order. Which means that all ASCII- and EBCDIC-based encodings should also have their digits in order. So for pretty much anything you'll encounter, barring Morse code or worse, I'm going to say yes.

提交回复
热议问题