Google Java Style Guide2.3 Special characters 2.3.1 Whitespace characters Aside from the line terminator sequence, the ASCII horizontal space char- acter (0x20) is the only whitespace character that appears anywhere in a source the corresponding octal (e.g. \012) or Unicode (e.g. \u000a) escape. 2.3.3 Non-ASCII characters For the remaining non-ASCII characters, either the actual Unicode character (e.g. ∞) or the equivalent Unicode Tip: Never make your code less readable simply out of fear that some programs might not handle non-ASCII characters properly. If that should happen, those programs are broken and they must be fixed. 3 Source0 码力 | 19 页 | 84.76 KB | 1 年前3
Google C++ Style Guidelength. Non-ASCII Characters Non-ASCII characters should be rare, and must use UTF-8 formatting. You shouldn’t hard-code user-facing text in source, even English, so use of non- ASCII characters should appropriate to hard-code the non-ASCII string(s) used in those data files as delimiters. More commonly, unittest code (which does not need to be localized) might contain non-ASCII strings. In such cases, you should use UTF-8, since that is an encoding understood by most tools able to handle more than just ASCII. Hex encoding is also OK, and encouraged where it enhances readability — for example, "\xEF\xBB\xBF"0 码力 | 83 页 | 238.71 KB | 1 年前3
共 2 条
- 1













