(swf file format spec v10)swf文件格式中英文说明书v10,字符串部分,笔记5

STRING(翻译略)
Field Type Comment
String UI8[zero or more] Non-null string character data
StringEnd UI8 Marks end of string; always zero
字符串类型就是指以空字符结尾的字符的序列。

In SWF 5 or earlier, STRING values are encoded using either ANSI (which is a superset of
ASCII) or shift-JIS (a Japanese encoding). You cannot indicate the encoding that is used;
instead, the decoding choice is made according to the locale in which Flash Player is running.
This means that text content in SWF 5 or earlier can only be encoded in ANSI or shift-JIS,
and the target audience must be known during authoring—otherwise garbled text results.
在swf5及更早的版本中,字符串不是使用ANSI编码(ASCII扩展集)就是采用shift-JIS(一种日本编码)。你不能确定使用的编码;相反,解码是由本地环境flash播放器运行的时候决定的。这意味着SWF5或更早的文件仅能使用ANSI 或 shift-JIS编码文本内容,并且目标受众在创作过程中,必须是已知的—不然容易混淆文本结果。

In SWF 6 or later, STRING values are always encoded by using the Unicode UTF-8 standard.
This is a multibyte encoding; each character is composed of between one and four bytes.
UTF-8 is a superset of ASCII; the byte range 0 to 127 in UTF-8 exactly matches the ASCII
mapping, and all ASCII characters 0 to 127 are represented by just one byte. UTF-8
guarantees that whenever a character other than character 0 (the null character) is encoded by
using more than one byte, none of those bytes are zero. This avoids the appearance of internal
null characters in UTF-8 strings, meaning that it remains safe to treat null bytes as string
terminators, just as for ASCII strings.
在swf6及以后版本中,字符串的值经常使用Unicode UTF-8编码。它是一种多字节的编码方式,它对字符编码使用1-4个字节。UTF-8编码是ASCII的一个超集;字节范围为0到127的UTF-8完全匹配的ASCII映射,所有ASCII字符0到127为代表的只是一个字节。UTF-8保证除了空字符以外的所有字符都使用一个以上的字节来表示,并且这些字节里面没有一个字节的值为0。空字符用一个字节来表示。这就保证了在一个UTF-8字符串里面不会出现不希望出现的空字符。

Language code
A language code identifies a spoken language that applies to text. Language codes are associated with font specifications in

the SWF file format.
NOTE:A language code does not specify a text encoding; it specifies a spoken language.
一个语言代码标识一种口语适用于文本。在SWF文件中,语言代码和文件格式的字体定义有关。
语言代码不决定文本编码,它仅仅是标识了一种口语。


LanguageCode UI8 Language code (see following)
语言代码UI8语言代码(见下文)

Flash Player uses language codes to determine line-breaking rules for dynamic text, and to choose backup fonts when a specified device font is unavailable. Other uses for language codes may be found in the future.
A language code of zero means no language. This code results in behavior that is dependent on the locale in which Flash Player is running.
Flash播放器利用语言代码来确定动态文本框中的换行规则,并且用来确定在当前设备字体不存在的时候选择什么样的替换字体。其它语言的用法在未来也许会发现。
如果语言代码为零的话,这个语言代码就靠本地环境Flash播放器运行。

At the time of writing, the following language codes are recognized by Flash Player:
■ 1 = Latin (the western languages covered by Latin-1: English, French, German, and so on)
■ 2 = Japanese
■ 3 = Korean
■ 4 = Simplified Chinese
■ 5 = Traditional Chinese

在撰写本文时,Flash播放器能够识别的语言代码一共有一下几种:
■ 1.拉丁字符,包括西方的一些语言,比如英语、法语、德语等等。
■ 2.日语
■ 3.韩语
■ 4.简体中文
■ 5.繁体中文
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值