班次序列 [英] Shift sequence

查看:53
本文介绍了班次序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不太了解换档顺序(7.1.1#5)。

有人可以开导我,给出一些例子吗?


问候,

Vijay Kumar R. Zanvar

-

凯文:嗨妈妈!我正在制作自己的报纸来报道我们家里的事件



妈妈:那很好。

凯文:现在我正在寻找一个页面一个主要故事。我可以吗?
采访你吗?

妈妈:当然

凯文:好的,你在那里吃什么晚餐?

妈妈:鱼。

Calvin:刀子焊接母亲身上的ICHTHYOIDS! GRIM MELEE是

即将举行的仪式!郊区家庭装置受害者!

妈妈:走出厨房!出来了! Out!

解决方案

Op 19 May 2005 08:50:42 -0700 schreef Vijay Kumar R. Zanvar:
< blockquote class =post_quotes>我不太了解班次序列(7.1.1#5)。
有人可以启发我,给出一些例子吗?

问候,
Vijay Kumar R. Zanvar




7.1标准输入和输出,第151页,K& R2

什么是''班次序列''?

-

咕咕


Coos Haak< ch *********** ********@hccnet.nl>写道:

Op 19 May 2005 08:50:42 -0700 schreef Vijay Kumar R. Zanvar:

我做的不太了解班次序列(7.1.1#5)。
有人可以启发我,给出一些例子吗?

问候,
Vijay Kumar R. Zanvar



7.1标准输入和输出,第151页,K& R2
什么是'班次序列'?




我猜这是关于C99标准(第164页):

移位序列是多字节内连续的字节序列

(可能)导致换档状态变化的字符串(见5.2.1.2)。

换档序列不应有相应的宽字符;它是

而是作为相邻多字节字符的附件。


问候,Jens

-

\ Jens Thoms Toerring ___ Je ********* **@physik.fu-berlin.de

\ __________________________ http://www.toerring.de





Vijay Kumar R. Zanvar写道:

我不太了解班次序列(7.1.1#5)。
有人可以启发我,给出一些例子吗?




它们是一种编码今天的大型曲目的方式。

" characters"仅使用典型实现''char''表示的小整数值。这个想法是

你通过一个'char''值流进行,用一些默认编码(初始移位状态)开始

,比如

ASCII:72,101,108,108,111表示H,e,l,l,o。在某些

点,您会遇到班次序列,一堆'char''

值不代表字符但相反意味着

以下`char''值应理解为希腊语

字母。你继续通过随后的'char''值

并再次找到72,101,108,108,111 - 但是因为你是

用这些值查看这些值新的眼睛,它们现在是

意味着Gamma,epsilon,lambda,lambda,omicron。 (注意:现在很明显,我知道没有希腊文;这个例子的目的是为了b / b
是说明性的而不是确定的。)


你继续收集'char''值并识别

希腊字母,直到你发生在另一个班次序列上

意味着这里来了一些日语字形,每个字形编码为相邻char值的
a组。再一次你改变了你的观点,当你下一次看到72,101,108,108,

111时,你就会理解这五个值一起作为一个/>
日语符号表示奢侈的复杂性。 (如果我的

希腊语不存在,我的日语就更少了 - 这可能是

吗?)


等等。许多C库函数需要字符串

在初始移位状态下开始和结束,意味着

默认编码在字符串的开头生效,

,如果字符串包含要转换的序列,则改为

其他编码在中间的某个地方,它还必须包含

a移位序列,在

到达字符串末尾之前返回默认编码。


这里有一些易于阅读的历史描述

和字符编码问题:

http://www.joelonsoftware.com/articles/Unicode.html


这篇文章主要关注的是跨网络交换不同的b $ b字符编码而不是关于C'的问题

这样,但它'尽管如此。


-


I do not know much about shift sequence(7.1.1#5).
Can somebody enlighten me, giving some examples?

Regards,
Vijay Kumar R. Zanvar
--
Calvin: Hi Mom! I''m making my own newspaper to report the events
of our household.
Mum: That''s nice.
Calvin: Now I''m looking for a page one lead story. Can I
interview you?
Mum: Sure
Calvin: OK, what are you cutting up there for dinner?
Mum: Fish.
Calvin: KNIFE WELDING MOTHER HACKS ICHTHYOIDS! GRIM MELEE IS
EVENING RITUAL! SUBURBAN FAMILY DEVOURS VICTIM!
Mum: Out of the kitchen! Out! Out!

解决方案

Op 19 May 2005 08:50:42 -0700 schreef Vijay Kumar R. Zanvar:

I do not know much about shift sequence(7.1.1#5).
Can somebody enlighten me, giving some examples?

Regards,
Vijay Kumar R. Zanvar



7.1 Standard Input and Output, page 151, K&R2
What is ''shift sequence''?
--
Coos


Coos Haak <ch*******************@hccnet.nl> wrote:

Op 19 May 2005 08:50:42 -0700 schreef Vijay Kumar R. Zanvar:

I do not know much about shift sequence(7.1.1#5).
Can somebody enlighten me, giving some examples?

Regards,
Vijay Kumar R. Zanvar


7.1 Standard Input and Output, page 151, K&R2
What is ''shift sequence''?



I guess it''s about the C99 standard (p. 164):

A shift sequence is a contiguous sequence of bytes within a multibyte
string that (potentially) causes a change in shift state (see 5.2.1.2).
A shift sequence shall not have a corresponding wide character; it is
instead taken to be an adjunct to an adjacent multibyte character.

Regards, Jens
--
\ Jens Thoms Toerring ___ Je***********@physik.fu-berlin.de
\__________________________ http://www.toerring.de




Vijay Kumar R. Zanvar wrote:

I do not know much about shift sequence(7.1.1#5).
Can somebody enlighten me, giving some examples?



They are a way of encoding today''s large repertoire of
"characters" using only the small integer values that a
typical implementation''s `char'' can express. The idea is
that you progress through a stream of `char'' values, starting
with some default encoding (the "initial shift state") like
ASCII: 72, 101, 108, 108, 111 means H, e, l, l, o. At some
point you encounter a "shift sequence," a bunch of `char''
values that do not represent "characters" but instead mean
"The following `char'' values are to be understood as Greek
letters." You plow along through the subsequent `char'' values
and again find 72, 101, 108, 108, 111 -- but because you are
looking at these values with new eyes, as it were, they now
mean Gamma, epsilon, lambda, lambda, omicron. (Note: it is
now obvious that I know no Greek; the example is intended to
be illustrative and not definitive).

You keep on collecting `char'' values and recognizing
Greek letters, until you happen on another "shift sequence"
that means "Here come some Japanese glyphs, each encoded as
a group of adjacent `char'' values." Once again you change
your point of view, and when you next see 72, 101, 108, 108,
111 you understand the five values taken together as one
Japanese symbol meaning "extravagant complexity." (If my
Greek is non-existent, my Japanese is even less so -- is
that possible?)

And so on. Many C library functions require strings that
"begin and end in the initial shift state," meaning that the
default encoding is in effect at the beginning of the string,
and that if the string contains shift sequences to change to
other encodings somewhere in the middle, it must also contain
a shift sequence that returns to the default encoding before
coming to the end of the string.

There''s an easy-to-read description of some of the history
and issues of character encodings at:

http://www.joelonsoftware.com/articles/Unicode.html

The article is mostly concerned with exchanging different
character encodings across networks and not about C''s issues
as such, but it''s informative nonetheless.

--


这篇关于班次序列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆