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:  如何处理中文编码 

留言

Google

本月熱門文章

水電行介紹---台北市大同區塔城街17號的富安水電行---斷垣殘壁內找到的甲級電匠師傅^^!!

熱門文章

企鵝妹/柳允進 史上最暈的TT三分鐘完整版一次看個夠

香港朋友,真的對唔住,台灣出了這種中共的幫兇!

陳昇 Bobby Chen【把悲傷留給自己 I left sadness to myself】Official Music Video

裝潢師傅貼圖來了唷

[黑金] 台南88槍擊案主犯國民黨學甲區黨部主委王文宗 也擔任統促黨幹部

新手自建監控雲最快的方式:推薦QNAP NAS 搭配QVR Pro

堅持5個月!反送中示威者六大特色 6 features of Hong Kong Anti-ELAB Protesters│老外看香港│郝毅博 Ben Hedges│新唐人電視台

香港朋友看服貿 - 嗨,我是香港人,一個CEPA的受害者。