由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - expression in Java
相关主题
char *p = "string literal"; 和 char a[] = "string liter (转载)请问如何判断一个文件内容是UNICODE 还是 ANSI
[合集] c++的题有熟悉boost的同学么?
一个c++小问题Python unicode问题
python 小问题这个python 3000
Pattern matching如何安装Ulipad
数据类型判断顺便问一个CreateFile问题 (转载)
java string streamhow can I convert CString to char*?
计算围棋棋盘合法图案的源代码 sucks (转载)
相关话题的讨论汇总
话题: u000a话题: string话题: java话题: linefeed话题: expression
进入Programming版参与讨论
1 (共1页)
s*****i
发帖数: 650
1
String b = "\u000A"; is syntax error.
String b = "\u0009"; is right,
String b = "\u001A"; is right too.
why?
How to input "\u000A" into a variable?
thx
d******p
发帖数: 24
2
http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100960
Because Unicode escapes are processed very early, it is not correct to
write '\u000a' for a character literal whose value is linefeed (LF); the
Unicode escape \u000a is transformed into an actual linefeed in translation
step 1 (§3.3) and the linefeed becomes a LineTerminator in step 2 (§3.4),
and so the character literal is not valid in step 3. Instead, one should
use the escape sequence '\n' (§3.10.6). Similarly, it

【在 s*****i 的大作中提到】
: String b = "\u000A"; is syntax error.
: String b = "\u0009"; is right,
: String b = "\u001A"; is right too.
: why?
: How to input "\u000A" into a variable?
: thx

1 (共1页)
进入Programming版参与讨论
相关主题
sucks (转载)Pattern matching
什么程序可以把中文转换成unicode ?数据类型判断
WIN32下怎么转文件名从ANSI到UNICODE ?java string stream
中文显示计算围棋棋盘合法图案的源代码
char *p = "string literal"; 和 char a[] = "string liter (转载)请问如何判断一个文件内容是UNICODE 还是 ANSI
[合集] c++的题有熟悉boost的同学么?
一个c++小问题Python unicode问题
python 小问题这个python 3000
相关话题的讨论汇总
话题: u000a话题: string话题: java话题: linefeed话题: expression