iOS URL decode 及 encode

在開發過android 現在改開發iOS,在文件上,真的iOS做得比android好很多。像是 About iOS App Programming
而關於iOS URL decode 及 encode的討論。其中什么是url encode参见 http://www.stringfunction.com/url-decode.html

官方文件

Understanding characters

A string object presents itself as an array of Unicode characters (Unicode is a registered trademark of Unicode, Inc.). You can determine how many characters a string object contains with the length method and can retrieve a specific character with the characterAtIndex: method. These two “primitive” methods provide basic access to a string object.
Most use of strings, however, is at a higher level, with the strings being treated as single entities: You compare strings against one another, search them for substrings, combine them into new strings, and so on. If you need to access string objects character by character, you must understand the Unicode character encoding, specifically issues related to composed character sequences. For details see The Unicode Standard, Version 4.0 (The Unicode Consortium, Boston: Addison-Wesley, 2003, ISBN 0-321-18578-1) and the Unicode Consortium web site: http://www.unicode.org/. See also “Characters and Grapheme Clusters” in String Programming Guide.

Interpreting UTF-16-encoded data

When creating an NSString object from a UTF-16-encoded string (or a byte stream interpreted as UTF-16), if the byte order is not otherwise specified, NSString assumes that the UTF-16 characters are big-endian, unless there is a BOM (byte-order mark), in which case the BOM dictates the byte order. When creating an NSString object from an array of Unicode characters, the returned string is always native-endian, since the array always contains Unicode characters in native byte order.
今天最重要的是介紹大絕招 stringByReplacingPercentEscapesUsingEncoding

參見 将UTF8编码转化为中文

others:  如何处理中文编码 

留言

搜尋

本月熱門文章

中國國民黨政治人物參與中國共產黨統戰學習?

日本旅行 去東京可以在哪邊買羽球相關用品?WEMBLEY/WINDSOR/梭家/Victoria/Alpen TOKYO/

[台海危機] 中國軍機擾台問題 2023/09/17-18 單日破百架次飛機 創新高

[台海危機] 2024/10/15 聯合利劍—2024B「153共機34共艦」圍台破單日紀錄 東南空域配合遼寧艦聯演

[社會觀察] 一生順遂與命途乖舛

堪比林益世李朝卿的前台北市長柯文哲

台灣只有兩種小孩

水電行介紹---台北市北投區的實踐街上的義憶水電行----很艋舺的台詞.

水電行介紹---台北市南港區研究院路二段30號的志興水電行---是水電行也是水電材料行

金融犯罪調查師 車禍身亡 疑點重重 金融正義的代價:陳梅慧離奇車禍死亡背後的疑雲

Agoda

熱門文章

[社會觀察] 一生順遂與命途乖舛

中華民國2024 總統、副總統選舉公告發布 連署參選門檻28萬9667人 可以推薦候選人的政黨包括民進黨、國民黨、民眾黨和時力

[FAANG面試] 如何準備Google Technical Program Manager (TPM) 面試

關於中國:202X年

[HMD Global] Nokia 2020 新手機發布 首款 5G 手機 Nokia 8.3 預計夏季開賣 !

[音樂] 霖霖 新單曲:給你了

[表特][Passion Sisters] 中信兄弟PS女孩 浮誇甜心 凱蒂 炸裂全場~ 小許瑋甯

[棒球] 2023 台灣大賽G5 威能帝13K飆破紀錄 猿3轟搶聽牌優勢