Instance Property インスタンスプロパティ

percentEncodedQuery

The query subcomponent, percent-encoded. queryswordent下位構成要素、パーセント符号化されます。

Declaration 宣言

var percentEncodedQuery: String? { get set }

Discussion 議論

The getter for this property retains any percent encoding this component may have. Setting this properties assumes the component string is already correctly percent encoded. Attempting to set an incorrectly percent encoded string will cause a fatalError. Although ‘;’ is a legal path character, it is recommended that it be percent-encoded for best compatibility with URL (String.addingPercentEncoding(withAllowedCharacters:) will percent-encode any ‘;’ characters if you pass CharacterSet.urlQueryAllowed). このプロパティに対するゲッターは、この構成要素が持つかもしれないあらゆるパーセント符号化をそのまま残します。このプロパティを設定することは、構成要素文字列がすでに正しくパーセント符号化されると仮定します。不正なパーセント符号化文字列を設定しようとする試みは、fatalErrorを引き起こすでしょう。たとえ ‘;’ が合法なバス文字列だとしても、URLとの最良の互換性のためにそれがパーセント符号化されることは推奨されます(String.addingPercentEncoding(withAllowedCharacters:)はあらゆる ‘;’ 文字をパーセント符号化するでしょう、あなたがCharacterSet.urlQueryAllowedを渡すならば)。

See Also 参照

Accessing Components in URL-Encoded Format 構成要素にURL符号化形式でアクセスする