我想为一种文件格式编写语法,其内容可以包含US-ASCII 以外的字符。由于我习惯了ABNF,所以我尝试使用它...
然而,没有一个 RFC 5234和7405对不使用美国 ASCII 的人非常友好。
事实上,我正在寻找一个面向字符而不是面向字节的 ABNF 版本(可能还有一些基本规则);RFC 5234 对此唯一要说的是第 2.4 节:
2.4. External Encodings
External representations of terminal value characters will vary
according to constraints in the storage or transmission environment.
Hence, the same ABNF-based grammar may have multiple external
encodings, such as one for a 7-bit US-ASCII environment, another for
a binary octet environment, and still a different one when 16-bit
Unicode is used. Encoding details are beyond the scope of ABNF,
although Appendix B provides definitions for a 7-bit US-ASCII
environment as has been common to much of the Internet.
By separating external encoding from the syntax, it is intended that
alternate encoding environments can be used for the same syntax.
这并没有真正澄清问题。
某处是否存在面向代码点而不是面向字节的 ABNF 版本?