ASCII UTF8中的代码?? [英] Code in ASCII UTF8??
问题描述
我知道ASCII''\'''是0x0d,''\ n''是0x0a。
但有人说UTF8中的ASCII字符没有变化。
现在我想知道UTF8''\ r''和''\ n''已经是0x0d和0x0a ??
有人可以告诉我吗?非常感谢!!!!
I know in ASCII ''\r'' is 0x0d,''\n'' is 0x0a.
But some say ASCII characters in UTF8 is unchanged.
Now I want to know in UTF8 ''\r'' and ''\n'' are already 0x0d and 0x0a??
Could anybody can tell me? Very Thanks!!!!
推荐答案
Le jeudi17février2005à09:38,chunhui_trueaécritdans
comp.lang.c *:
Le jeudi 17 février 2005 à 09:38, chunhui_true a écrit dans
comp.lang.c*:
我知道ASCII''\'''是0x0d,''\ n''是0x0a。
但有人说UTF8中的ASCII字符没有改变。
现在我想知道UTF8''\'''和''\ n''已经是0x0d和0x0a ??
任何人都可以告诉我?非常感谢!!!!
I know in ASCII ''\r'' is 0x0d,''\n'' is 0x0a.
But some say ASCII characters in UTF8 is unchanged.
Now I want to know in UTF8 ''\r'' and ''\n'' are already 0x0d and 0x0a??
Could anybody can tell me? Very Thanks!!!!
这是正确的。所有ASCII字符(0x00到0x7f)在
UTF-8中保持不变。从0x80起的所有Unicode值都被编码为2,3或4个字节
从不重复使用0x00到0x7f。
-
___________ 17/02/2005 11:21:46
_ / _ \_`_`_`_)Serge PACCALIN - sp ad mailclub.net
\ \ _L_)Il faut donc que les hommes startsnt
- ''(__)parn''êtrepasfanatiquespourmériter
_ / ___( la)tolérance。 - Voltaire,1763
That''s correct. All ASCII characters (0x00 to 0x7f) are unchanged in
UTF-8. All Unicode values from 0x80 up are encoded into 2, 3, or 4 bytes
that never reuse 0x00 to 0x7f.
--
___________ 17/02/2005 11:21:46
_/ _ \_`_`_`_) Serge PACCALIN -- sp ad mailclub.net
\ \_L_) Il faut donc que les hommes commencent
-''(__) par n''être pas fanatiques pour mériter
_/___(_) la tolérance. -- Voltaire, 1763
2005年2月17日星期四00:38:52 -0800,chunhui_true写道:
On Thu, 17 Feb 2005 00:38:52 -0800, chunhui_true wrote:
I知道在ASCII''\'''是0x0d,''\ n''是0x0a。
I know in ASCII ''\r'' is 0x0d,''\n'' is 0x0a.
不是那样在Mac上反过来?
劳伦斯
Wasn''t that the other way around on Macs?
Lawrence
Lawrence Kirby写道:
Lawrence Kirby wrote:
2月17日星期四2005 00:38:52 -0800,chunhui_true写道:
On Thu, 17 Feb 2005 00:38:52 -0800, chunhui_true wrote:
我知道ASCII''\'''是0x0d,''\ n''是0x0a。
I know in ASCII ''\r'' is 0x0d,''\n'' is 0x0a.
那不是Mac上的另一种方式吗?
Wasn''t that the other way around on Macs?
< shrug>取决于''\ r''和''\ n''的含义。 :-)
在Mac上,文本文件的行尾指示符(C89草案2.1.1.2)
是0x0D。当这被读入C程序时,它被翻译成
a''\ n''字符。
如果有人有Mac使用C编译器,他们可以告诉我们这个程序在该系统上打印的内容吗?
#include< stdio.h>
int main(无效)
{
printf(" \\\r =%d \ n",' '\ r'');
printf(" \\\\\
=%d \ n",''\ n'');
返回0;
}
<shrug> depends what you mean by ''\r'' and ''\n''. :-)
On a Mac, a text file''s end-of-line indicator (C89 draft 2.1.1.2)
is 0x0D. When this is read into a C program, it is translated into
a ''\n'' character.
If anyone''s got a Mac with a C compiler, could they please tell us
what this program prints on that system?
#include <stdio.h>
int main(void)
{
printf("\\\r = %d\n", ''\r'');
printf("\\\n = %d\n", ''\n'');
return 0;
}
这篇关于ASCII UTF8中的代码??的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!