Loading…
graceyu
Translation approved |
|
graceyu
Translation approved |
<p>
<b><big>Percent Encoding</big></b><br> The issue is complicated. It is recommended to avoid reserved characters and spaces for component values in URIs if the values are under your control (e.g. you cannot avoid it when you must specify such characters in values for an URI to access a remote print queue but the remote print queue is not under your control). Whenever possible use only so called 'unreserved characters'. Unreserved characters are uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. Even hyphen, period, tilde, and case sensitivity could cause special issues in special cases (e.g. only letters, digits, and underscore are known to work for a CUPS print queue name and case is not significant there). Therefore it is best to use only lowercase letters, digits, and underscore for all values in all URIs if possible.<br> Reserved characters and space characters in the value of a component must be percent-encoded (also known as URL encoding).<br> When an input field in the dialog is intended to enter only a single value for a single component of the URI (e.g. separated input fields for username and password), you must enter spaces and reserved characters literally (i.e. non-percent-encoded). For such input fields all spaces and reserved characters will be automatically percent-encoded. For example if a password is actually 'Foo%20Bar' (non-percent-encoded), it must be entered literally in the password input field in the dialog. The automated percent-encoding results 'Foo%2520Bar' which is how the value of the password component is actually stored in the URI.<br> In contrast when an input field in the dialog is intended to enter more that a single value for a single component of the URI (e.g. a single input field for all optional parameters like 'option1=value1&option2=value2&option3=value3' or a single input field to enter the whole URI), you must enter spaces and reserved characters percent-encoded because an automated percent-encoding is no longer possible. Assume in an optional parameter 'option=value' the value would be 'this&that' so that the whole optional parameter would be 'option=this&that' (literally). But a literal '&' character denotes the separation of different optional parameters so that 'option=this&that' in an URI means a first optional parameter 'option=this' and a second optional parameter which is only 'that'. Therefore a single optional parameter 'option=this&that' must be entered percent-encoded as 'option=this%26that'<br> Input fields which require percent-encoded input are denoted by a '[percent-encoded]' hint.<br> Listing of characters and their percent encoding:<br> space ' ' is percent encoded as %20<br> exclamation mark ! is percent encoded as %21<br> number sign # is percent encoded as %23<br> Dollar sign $ is percent encoded as %24<br> percentage % is percent encoded as %25<br> ampersand & is percent encoded as %26<br> apostrophe / single quotation mark ' is percent encoded as %27<br> left parenthesis ( is percent encoded as %28<br> right parenthesis ) is percent encoded as %29<br> asterisk * is percent encoded as %2A<br> plus sign + is percent encoded as %2B<br> comma , is percent encoded as %2C<br> slash / is percent encoded as %2F<br> colon : is percent encoded as %3A<br> semicolon ; is percent encoded as %3B<br> equals sign = is percent encoded as %3D<br> question mark ? is percent encoded as %3F<br> at sign @ is percent encoded as %40<br> left bracket [ is percent encoded as %5B<br> right bracket ] is percent encoded as %5D<br> For details see 'Uniform Resource Identifier (URI): Generic Syntax' at<br> http://tools.ietf.org/html/rfc3986 </p>
<p>
<b><big>百分比編碼</big></b><br> 該問題比較複雜。 如果 URI 中的元件值受您的控制, 建議您避免對這些值使用保留字元和空格 (例如,當必須在 URI 的值中指定這種字元 才能存取遠端列印佇列,而遠端列印佇列不受 您控制的情況下,您就無法避免使用它)。 應盡可能地使用所謂的 非保留字元是大寫和小寫字母、十進位數字、 連字號、句點、底線和波狀符號。 在特殊情況下,即使是連字號、句點、波狀符號 和區分大小寫也會導致特殊問題 (例如,我們已經知道,對於 CUPS 列印佇列名稱, 只能輸入字母、數字和底線,而大小寫並不重要)。 因此,對於所有 URI 中的所有值,在可能的情況下, 最好是只使用小寫字母、數字和底線。<br> 元件值中的保留字元和空格字元必須進行 百分比編碼 (又稱為 URL 編碼)。<br> 如果只能在對話方塊的輸入欄位中 輸入單個 URI 元件的單個值 (例如,使用者名稱和密碼的單個輸入欄位), 則必須輸入文字形式的空格和保留字元 (即未進行百分比編碼)。 對於這種輸入欄位,所有空格和 保留字元將自動進行百分比編碼。 例如,如果密碼實際上是 則必須在對話方塊的密碼輸入欄位中輸入文字形式的密碼。 而真正在 URI 中儲存的密碼元件值則是 其自動進行過百分比編碼的結果 反之,如果要在對話方塊的輸入欄位中輸入 單個 URI 元件的多個值 (例如,要在單個輸入欄位中輸入所有選擇性參數,如 或者要在單個輸入欄位中輸入完整的 URI), 則必須輸入經過百分比編碼的空格和保留字元, 因為此時不再能夠自動進行百分比編碼。 假設在選擇性參數 value 是 選擇性參數應該是 但是, 不同選擇性參數的分隔字元,也就是說, URI 中的 第一個選擇性參數為 選擇性參數僅為 因此,對於單個選擇性參數 必須輸入百分比編碼的 要求輸入百分比編碼值的輸入欄位 帶有 字元及其百分比編碼的清單:<br> 空格 感歎號 ! 的百分比編碼為 %21<br> 編號符號 # 的百分比編碼為 %23<br> 貨幣符號 $ 的百分比編碼為 %24<br> 百分比符號 % 的百分比編碼為 %25<br> 與號 & 的百分比編碼為 %26<br> 單引號 ' 的百分比編碼為 %27<br> 左圓括弧 ( 的百分比編碼為 %28<br> 左圓括弧 ) 的百分比編碼為 %29<br> 星號 * 的百分比編碼為 %2A<br> 加號 + 的百分比編碼為 %2B<br> 逗號 , 的百分比編碼為 %2C<br> 斜線 / 的百分比編碼為 %2F<br> 冒號 : 的百分比編碼為 %3A<br> 分號 ; 的百分比編碼為 %3B<br> 等號 = 的百分比編碼為 %3D<br> 問號 ? 的百分比編碼為 %3F<br> @ 符號的百分比編碼為 %40<br> 左方括號 [ 的百分比編碼為 %5B<br> 右方括號 ] 的百分比編碼為 %5D<br> 如需詳細資料,請參閱 http://tools.ietf.org/html/rfc3986 </p> |
Things to check
Source string description
ConnectionWizardDialog help 3/7:Flags
c-format
<b><big>Percent Encoding</big></b><br>
The issue is complicated.
It is recommended to avoid reserved characters and spaces
for component values in URIs if the values are under your control
(e.g. you cannot avoid it when you must specify such characters
in values for an URI to access a remote print queue
but the remote print queue is not under your control).
Whenever possible use only so called 'unreserved characters'.
Unreserved characters are uppercase and lowercase letters,
decimal digits, hyphen, period, underscore, and tilde.
Even hyphen, period, tilde, and case sensitivity
could cause special issues in special cases
(e.g. only letters, digits, and underscore are known to work
for a CUPS print queue name and case is not significant there).
Therefore it is best to use only lowercase letters, digits,
and underscore for all values in all URIs if possible.<br>
Reserved characters and space characters in the value of a component
must be percent-encoded (also known as URL encoding).<br>
When an input field in the dialog is intended to enter
only a single value for a single component of the URI
(e.g. separated input fields for username and password),
you must enter spaces and reserved characters literally
(i.e. non-percent-encoded).
For such input fields all spaces and reserved characters
will be automatically percent-encoded.
For example if a password is actually 'Foo%20Bar' (non-percent-encoded),
it must be entered literally in the password input field in the dialog.
The automated percent-encoding results 'Foo%2520Bar' which is how
the value of the password component is actually stored in the URI.<br>
In contrast when an input field in the dialog is intended to enter
more that a single value for a single component of the URI
(e.g. a single input field for all optional parameters
like 'option1=value1&option2=value2&option3=value3'
or a single input field to enter the whole URI),
you must enter spaces and reserved characters percent-encoded
because an automated percent-encoding is no longer possible.
Assume in an optional parameter 'option=value'
the value would be 'this&that' so that the whole
optional parameter would be 'option=this&that' (literally).
But a literal '&' character denotes
the separation of different optional parameters
so that 'option=this&that' in an URI means
a first optional parameter 'option=this' and
a second optional parameter which is only 'that'.
Therefore a single optional parameter 'option=this&that'
must be entered percent-encoded as 'option=this%26that'<br>
Input fields which require percent-encoded input
are denoted by a '[percent-encoded]' hint.<br>
Listing of characters and their percent encoding:<br>
space ' ' is percent encoded as %20<br>
exclamation mark ! is percent encoded as %21<br>
number sign # is percent encoded as %23<br>
Dollar sign $ is percent encoded as %24<br>
percentage % is percent encoded as %25<br>
ampersand & is percent encoded as %26<br>
apostrophe / single quotation mark ' is percent encoded as %27<br>
left parenthesis ( is percent encoded as %28<br>
right parenthesis ) is percent encoded as %29<br>
asterisk * is percent encoded as %2A<br>
plus sign + is percent encoded as %2B<br>
comma , is percent encoded as %2C<br>
slash / is percent encoded as %2F<br>
colon : is percent encoded as %3A<br>
semicolon ; is percent encoded as %3B<br>
equals sign = is percent encoded as %3D<br>
question mark ? is percent encoded as %3F<br>
at sign @ is percent encoded as %40<br>
left bracket [ is percent encoded as %5B<br>
right bracket ] is percent encoded as %5D<br>
For details see 'Uniform Resource Identifier (URI): Generic Syntax' at<br>
http://tools.ietf.org/html/rfc3986
</p>
<b><big>百分比編碼</big></b><br>
該問題比較複雜。
如果 URI 中的元件值受您的控制,
建議您避免對這些值使用保留字元和空格
(例如,當必須在 URI 的值中指定這種字元
才能存取遠端列印佇列,而遠端列印佇列不受
您控制的情況下,您就無法避免使用它)。
應盡可能地使用所謂的 “非保留字元”。
非保留字元是大寫和小寫字母、十進位數字、
連字號、句點、底線和波狀符號。
在特殊情況下,即使是連字號、句點、波狀符號
和區分大小寫也會導致特殊問題
(例如,我們已經知道,對於 CUPS 列印佇列名稱,
只能輸入字母、數字和底線,而大小寫並不重要)。
因此,對於所有 URI 中的所有值,在可能的情況下,
最好是只使用小寫字母、數字和底線。<br>
元件值中的保留字元和空格字元必須進行
百分比編碼 (又稱為 URL 編碼)。<br>
如果只能在對話方塊的輸入欄位中
輸入單個 URI 元件的單個值
(例如,使用者名稱和密碼的單個輸入欄位),
則必須輸入文字形式的空格和保留字元
(即未進行百分比編碼)。
對於這種輸入欄位,所有空格和
保留字元將自動進行百分比編碼。
例如,如果密碼實際上是
”“Foo%20Bar” (未進行百分比編碼),則必須在對話方塊的密碼輸入欄位中輸入文字形式的密碼。
而真正在 URI 中儲存的密碼元件值則是
其自動進行過百分比編碼的結果 “Foo%2520Bar”。<br>
反之,如果要在對話方塊的輸入欄位中輸入
單個 URI 元件的多個值
(例如,要在單個輸入欄位中輸入所有選擇性參數,如
“option1=value1&option2=value2&option3=value3”,
或者要在單個輸入欄位中輸入完整的 URI),
則必須輸入經過百分比編碼的空格和保留字元,
因為此時不再能夠自動進行百分比編碼。
假設在選擇性參數 “option=value” 中,
value 是 “this&that”,那麼,整個
選擇性參數應該是 “option=this&that” (文字形式)。
但是,”&” 文字字元表示
不同選擇性參數的分隔字元,也就是說,
URI 中的 “option=this&that” 表示
第一個選擇性參數為 “option=this”,第二個
選擇性參數僅為 “that”。
因此,對於單個選擇性參數 “option=this&that”,
必須輸入百分比編碼的 “option=this%26that”<br>
要求輸入百分比編碼值的輸入欄位
帶有 “[百分比編碼]” 提示。<br>
字元及其百分比編碼的清單:<br>
空格 “ “ 的百分比編碼為 %20<br>
感歎號 ! 的百分比編碼為 %21<br>
編號符號 # 的百分比編碼為 %23<br>
貨幣符號 $ 的百分比編碼為 %24<br>
百分比符號 % 的百分比編碼為 %25<br>
與號 & 的百分比編碼為 %26<br>
單引號 ' 的百分比編碼為 %27<br>
左圓括弧 ( 的百分比編碼為 %28<br>
左圓括弧 ) 的百分比編碼為 %29<br>
星號 * 的百分比編碼為 %2A<br>
加號 + 的百分比編碼為 %2B<br>
逗號 , 的百分比編碼為 %2C<br>
斜線 / 的百分比編碼為 %2F<br>
冒號 : 的百分比編碼為 %3A<br>
分號 ; 的百分比編碼為 %3B<br>
等號 = 的百分比編碼為 %3D<br>
問號 ? 的百分比編碼為 %3F<br>
@ 符號的百分比編碼為 %40<br>
左方括號 [ 的百分比編碼為 %5B<br>
右方括號 ] 的百分比編碼為 %5D<br>
如需詳細資料,請參閱 “資源識別字串 (URI):通用語法”,網址為:<br>
http://tools.ietf.org/html/rfc3986
</p>