zoukankan      html  css  js  c++  java
  • NSString编码形式是UTF–16

    String Objects

    An NSString object encodes a Unicode-compliant text string, represented as a sequence of UTF–16 code units. All lengths, character indexes, and ranges are expressed in terms of 16-bit platform-endian values, with index values starting at 0.

    An NSString object can be initialized from or written to a C buffer, an NSData object, or the contents of an NSURL. It can also be encoded and decoded to and from ASCII, UTF–8, UTF–16, UTF–32, or any other string encoding represented by NSStringEncoding.

     

    Base64要求把每三个8Bit的字节转换为四个6Bit的字节(3*8 = 4*6 = 24),然后把6Bit再添两位高位0,组成四个8Bit的字节,也就是说,转换后的字符串理论上将要比原来的长1/3。
     
    规则
    关于这个编码的规则:
    ①.把3个字符变成4个字符。
    ②每76个字符加一个换行符。
    ③.最后的结束符也要处理。
  • 相关阅读:
    彻悟大师语录
    读书
    复变函数简要
    【洛谷P4781】【模板】拉格朗日插值
    【洛谷P4585】火星商店问题
    【YbtOJ#593】木棍问题
    【YbtOJ#893】带权的图
    【洛谷P4735】最大异或和
    【洛谷P5787】二分图 /【模板】线段树分治
    【ARC098D】Donation
  • 原文地址:https://www.cnblogs.com/dengchaojie/p/6993947.html
Copyright © 2011-2022 走看看