GB2312/GBK字库中的汉字,有没有可能有一个汉字的高字节或者低字节ASCII码等于空格或者Tab的?

ooolinux 2018-06-23 07:34:00
我有一个文本文件,每一行由若干个空格或者Tab键隔开若干个列,每一列都包含汉字和/或英语字母,想用sscanf来提取每一列,
想问GB2312/GBK字库中的汉字,有没有可能有一个汉字的高字节或者低字节ASCII码值恰好等于空格或者Tab的?
程序不使用Unicode。
...全文
398 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
赵4老师 2018-06-25
  • 打赏
  • 举报
回复
引用 11 楼 u010165006 的回复:
[quote=引用 10 楼 zhao4zhong1 的回复:]
MSDN98_1.ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2.ISO http://pan.baidu.com/s/1bnGo0Vl


很多NT的API都没有吧?[/quote]
例子代码最良心,安装体积最小的一个版本。

新API请直接在百度搜“新API名称 site:microsoft.com”
ooolinux 2018-06-25
  • 打赏
  • 举报
回复
引用 10 楼 zhao4zhong1 的回复:
MSDN98_1.ISO http://pan.baidu.com/s/1dDF41ix, MSDN98_2.ISO http://pan.baidu.com/s/1bnGo0Vl


很多NT的API都没有吧?
赵4老师 2018-06-25
  • 打赏
  • 举报
回复
ooolinux 2018-06-24
  • 打赏
  • 举报
回复
老赵资料详实~
赵4老师 2018-06-24
  • 打赏
  • 举报
回复
引用 7 楼 u010165006 的回复:
不知道还有么有哪个字符被scanf当做空白字符的?

space,tab,carriage return,new line

Format Specification Fields: scanf and wscanf Functions
A format specification has the following form:

%
  • [width] [{h | l | I64 | L}]type

    The format argument specifies the interpretation of the input and can contain one or more of the following:

    White-space characters: blank (' '); tab ('\t'); or newline ('\n'). A white-space character causes scanf to read, but not store, all consecutive white-space characters in the input up to the next non–white-space character. One white-space character in the format matches any number (including 0) and combination of white-space characters in the input.


    Non–white-space characters, except for the percent sign (%). A non–white-space character causes scanf to read, but not store, a matching non–white-space character. If the next character in stdin does not match, scanf terminates.


    Format specifications, introduced by the percent sign (%).
Saleayas 2018-06-23
  • 打赏
  • 举报
回复
不可能,高位为 1 的。
ooolinux 2018-06-23
  • 打赏
  • 举报
回复
不知道还有么有哪个字符被scanf当做空白字符的?
ooolinux 2018-06-23
  • 打赏
  • 举报
回复
引用 5 楼 zhao4zhong1 的回复:
空格 0x20
Tab 0x09


那这两个是够不着了。
赵4老师 2018-06-23
  • 打赏
  • 举报
回复
空格 0x20
Tab 0x09
ooolinux 2018-06-23
  • 打赏
  • 举报
回复
引用 3 楼 zhao4zhong1 的回复:
//GBK汉字内码范围(不包括A1xx~A9xx的标点符号英文字母特殊符号等)
//区码 ,位码
//81-A0 ,40-7E 80-FE
//AA-AF ,40-7E 80-A0
//B0-D6 ,40-7E 80-FE
//D7 ,40-7E 80-F9
//D8-F7 ,40-7E 80-FE
//F8-FE ,40-7E 80-A0


40-7E这个高位是0了?
赵4老师 2018-06-23
  • 打赏
  • 举报
回复
//GBK汉字内码范围(不包括A1xx~A9xx的标点符号英文字母特殊符号等)
//区码 ,位码
//81-A0 ,40-7E 80-FE
//AA-AF ,40-7E 80-A0
//B0-D6 ,40-7E 80-FE
//D7 ,40-7E 80-F9
//D8-F7 ,40-7E 80-FE
//F8-FE ,40-7E 80-A0
ooolinux 2018-06-23
  • 打赏
  • 举报
回复
引用 1 楼 Saleayas 的回复:
不可能,高位为 1 的。


没错了

3,881

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 其它技术问题
社区管理员
  • 其它技术问题社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧