You are here: Strings > textdecoder.

textdecoder.

Decodes a string from a number of different text encodings into plain text.The following encoding types are supported:

URL(编码百分比)

This encoding is used to ensure that a string is valid for inclusion in a URL. All characters that are not a letter, digit, dash, period, underscore or tilde will be encoded. The TextDecoder converts an encoded string such as黑色%20%26%20Whiteinto its decoded formblack & white.

Unicode Code Point (\Uxxxx or U+xxxx)

此编码用于在ASCII字符串中编码非ASCII字符。有两个常用的表示:\ uxxxx和u + xxxx,其中'xxxx'字符串表示Unicode代码点的十六进制值。例如,西里尔字符ӥ表示为\ u04e4或u + 04e4。TextDecoder将包含代码点引用的字符串转换为UTF-8字符串,其中代码点解除了。任何不是Unicode代码点的字符都将不变。例如,字符串'u + 0f06Εa\ u03a8'将被解码为'εaψ'

XML.

This encoding is used to ensure strings are acceptable for use in an XML document. Characters that have syntactic meaning in XML are escaped, using the following mapping:

特点 Encoded Value
< <
> >
" "
& &
' '

In addition, the XML encoding allows for any character to be represented using the decimal or hexadecimal representation of its Unicode code point. The TextDecoder converts an XML encoded string, such asblack & whiteinto its plain text representation,black & white.

HTML.

该编码是XML编码的扩展。HTML编码包括许多字符,不能使用简单的拉丁字符集表示,例如♪,±或∞。TextDecoder将转换HTML编码的字符串,例如this &plusm; thatinto its plain text representation,this ± that.

Base64

Base64 encoding is a method of storing arbitrary data as an ASCII string. The TextDecoder will convert Base64 encoded data into a text string. The Base64 data will be decoded into a sequence of bytes, which will then be interpreted using the character encoding given in the Character Encoding for Binary Data parameter.

HEX

HEX encoding is another method used to store arbitrary data as an ASCII string. The TextDecoder will convert HEX encoded data to a text string. The HEX data will be decoded into a sequence of bytes, which will then be interpreted using the character encoding given in the Character Encoding for Binary Data parameter.

Parameters

Editing Transformer Parameters

Using a set of menu options, transformer parameters can be assigned by referencing other elements in the workspace. More advanced functions, such as an advanced editor and an arithmetic editor, are also available in some transformers. To access a menu of these options, clickbeside the applicable parameter. For more information, seeTransformer Parameter Menu Options.

Transformer Categories

Strings

Transformer History

Selecting URL as the Encoding Type replaces the URLDecoder transformer, which is now deprecated.

搜索FME知识中心

搜索有关此变压器的样本和信息FME Knowledge Center.

TagsKeywords: URLDecoder decode encode