- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
在标准中,经常引用“初始移位状态”这个术语,似乎也出现在各种上下文中,例如多字节字符(字符串)和文件。但该标准错过了对其到底是什么的解释。
那是什么?一般来说,这里的“转变”是什么?
另外:
因为这个术语对我来说似乎用在不同的上下文中(在字符上下文中、在字符串上下文中和在文件上下文中),所以我将指出标准中的一些文本短语(尤其是 ISO/IEC:9899/2018 (C18)),其中包括术语“初始换档状态”:
§ 5.2.1.2 - Multibyte characters
— A multibyte character set may have a state-dependent encoding, wherein each sequence of multibyte characters begins in an initial shift state and enters other locale-specific shift states when specific multibyte characters are encountered in the sequence.
— An identifier, comment, string literal, character constant, or header name shall begin and end in the initial shift state.
§ 7.21.3 - Files
"— A file need not begin nor end in the initial shift state.274)"
"274)Setting the file position indicator to end-of-file, as with fseek(file, 0, SEEK_END), has undefined behavior for a binary stream (because of possible trailing null characters) or for any stream with state-dependent encoding that does not assuredly end in the initial shift state."
§7.21.6.2 - The fscanf function
For the
s
conversion specifier:"If an l length modifier is present, the input shall be a sequence of multibyte characters that begins in the initial shift state."
"
是否是格式字符串的开头和结尾?提前致谢。
最佳答案
移位状态是指将某些字节序列解释为字符的状态,这与编码相关。
来自https://www.gnu.org/software/libc/manual/html_node/Shift-State.html
In some multibyte character codes, the meaning of any particular byte sequence is not fixed; it depends on what other sequences have come earlier in the same string. Typically there are just a few sequences that can change the meaning of other sequences; these few are called shift sequences and we say that they set the shift state for other sequences that follow.
To illustrate shift state and shift sequences, suppose we decide that the sequence 0200 (just one byte) enters Japanese mode, in which pairs of bytes in the range from 0240 to 0377 are single characters, while 0201 enters Latin-1 mode, in which single bytes in the range from 0240 to 0377 are characters, and interpreted according to the ISO Latin-1 character set. This is a multibyte code that has two alternative shift states (“Japanese mode” and “Latin-1 mode”), and two shift sequences that specify particular shift states.
初始移位状态只是最初的移位状态,即处理开始时的状态;在上面的示例中,它将是相关序列开始的 ISO Latin-1 或日语中的任何一个。
关于c++ - "initial shift state"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59471459/
我正在尝试实现 Intellij 之类的双类导航。我发现它被称为“快速打开文件”的“序列键绑定(bind)”。 因此,我在 .sublime-keymap --- USER 中添加了这一行 { "
this.x = (Math.random()*canvasWidth); this.y = (Math.random()*canvasHeight); (1) this.shift = {x: th
我目前正在研究编译器,据我了解,在 LR(0) 中,有时会出现“shift/reduce”或“reduce/reduce”冲突,但不可能出现“shift/shift”冲突!为什么我们不能发生“转变/转
我希望使用 AutoHotKey 来修改我的 shift 键的功能。 Steve Losh 的博客条目 here 中描述了该功能。 .具体来说,我希望我的 shift 键执行以下操作: 如果 LShi
在我的Redis数据库中,我有一个以prefix:格式保存的键列表,所以示例数据库看起来像这样:。问题是,当我尝试删除前缀:1时,因为无论出于什么原因,我都需要删除IPSUM,在索引之间留下了一个间隙
在我的Redis DB中,我有一个以prefix:格式保存的键列表,因此示例数据库如下所示:。问题是,当我尝试删除前缀:1时,因为无论出于什么原因,我都需要删除IPSUM,在索引之间留下了一个间隙--
Listview 控件中是否有可以上下移动项目的功能? 最佳答案 我没有太多使用 TListView(我主要使用数据库网格),我把你的问题作为学习一些东西的机会。下面的代码是结果,它比大卫的答案更直观
我有点难以发现这两种操作的不同之处。所以我读到算术移位与逻辑移位基本相同,唯一的区别是它以某种方式保持最高位或有符号位。 所以当我在 101110 上做 LSL #2 时假设这个二进制是一个无符号的,
我正在尝试使用 shift+shift 配置键映射,这可能吗? 我试过: But this maps shift + S and this that maps to unknown 最佳答案 您不
我正在努力在 vim 中绑定(bind) Shift+- 组合。我已经尝试了以下两种选项,但都没有可用的选项,并且谷歌搜索没有带来任何相关信息。 nnoremap - nnoremap - 我正在
我正在使用基于Gallery 的Cover-flow,正如建议的那样here . 是否有可以捕获的事件表明在我的画廊/封面流中进行了一次移位(向左或向右)? 需要明确的是,如果我给画廊一个像样的滑动并
这个问题在这里已经有了答案: Cocoa - NSEvent Respond to the SHIFT key? (5 个答案) 关闭 3 年前。 我正在制作这个应用程序,我想检测是否检测到 shi
我不允许在我的 C 代码中使用浮点变量(出于性能原因)。我想进行整数除法运算,同时我想尽可能地防止除法损失。 我的理解是,如果分子很大,除法运算会产生很好的结果。目前我正在对分子进行左移操作以使其成为
我有一个文本输入,当用户按下 shift(keydown)并绑定(bind)一个监听器以监听 shift 键时,它现在变得透明 即。 $('#foo').keydown(function(){
我有一个包含 shift 命令的 bash 脚本。 它在 bash 中运行正常,但在 zsh 环境中,shift 命令似乎不同。 zsh $ shift shift: shift count must
我正在使用 Fedora 29 中包含的 vim: VIM - Vi IMproved 8.1(2018 年 5 月 18 日,2019 年 2 月 4 日 14:19:12 编译) 我刚刚注意到按
我有一个包含 shift 命令的 bash 脚本。 它在 bash 中运行正常,但在 zsh 环境中,shift 命令似乎不同。 zsh $ shift shift: shift count must
我正在使用 Fedora 29 中包含的 vim: VIM - Vi IMproved 8.1(2018 年 5 月 18 日,2019 年 2 月 4 日 14:19:12 编译) 我刚刚注意到按
我可以使用 UITextViewDelegate 或 NSNotificationCenter 来检测用户何时点击 Keyboard 上的字符键将文本输入到 UITextView. 但我的应用程序需要
当我尝试单击 shift + tab 组合时, Shiftkey 被触发 $("#buttonZZ").on("keydown",function (eve) { if (eve.keyCod
我是一名优秀的程序员,十分优秀!