数字是否在所有文本编码中按顺序表示? [英] Are digits represented in sequence in all text encodings?

查看:142
本文介绍了数字是否在所有文本编码中按顺序表示?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题是语言不可知的,但是受到这些c / c ++问题的启发。

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

如何将单个字符转换为int

C中的Char到int转换

可以安全地假设数字(0123456789)的字符在所有文本编码中出现吗?

Is it safe to assume that the characters for digits (0123456789) appear contigiously in all text encodings?

ie是否可以假定

'9'-'8' = 1
'9'-'7' = 2
...
'9'-'0' = 9

所有编码?

我期待着对这一个的确定答案:)

I'm looking forward to a definitive answer to this one :)

谢谢,

更新:确定,让我限制所有编码表示任何与ASCII和/或EBCDIC一样旧之后。 Sandscrit我不太在乎。 。

Update: OK, let me limit all encodings to mean anything as old as ASCII and/or EBCDIC and afterwards. Sandscrit I'm not so worried about . . .

推荐答案

我不知道所有编码,但至少在ASCII和&颤动> EBCDIC,数字0-9全部连续递增,以数字顺序递增。这意味着所有基于ASCII和EBCDIC的编码也应该有数字的顺序。所以,几乎任何你会遇到的,除了莫尔斯电码或更糟糕的是,我要去说是的。

I don't know about all encodings, but at least in ASCII and <shudder> 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.

这篇关于数字是否在所有文本编码中按顺序表示?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆