iphone-common-codes-ccteam 소스 코드 CCEncoding.h

4925 단어 encoding
//
// CCEncoding.h
// CCFC
//
// Created by xichen on 11-12-18.
// Copyright 2011 ccteam. All rights reserved.
//


#import <Foundation/Foundation.h>


// " " unicode :
// 0x48 0x96 0xE6 0x66
// UTF8 :
// 0xE9 0x99 0x88 0xE6 0x9B 0xA6
// GB18030 :
// 0xB3 0xC2 0xEA 0xD8
@interface CCEncoding : NSObject
{


}


// log all encodings
+ (void)logAllEncodings;




// unicode ---> UTF8
+ (const char *)UnicodeToUTF8:(NSString *)src;


// UTF8 ---> unicode
+ (NSString *)UTF8ToUnicode:(const char *)src;


// GB18030 ---> unicode
+ (NSString *)GB18030ToUnicode:(const char *)src;


// unicode ---> GB18030
+ (const char *)UnicodeToGB18030:(NSString *)src;


// GB18030 ---> UTF8
// GB18030 --> Unicode --> UTF8
+ (const char *)GB18030ToUTF8:(const char *)src;


// UTF8 ---> GB18030
// UTF8 --> Unicode --> GB18030
+ (const char *)UTF8ToGB18030:(const char *)src;


// Unicode cStr to Unicode NSString
// you should make sure the cStr begins with 0xFF, 0xFE(the unicode flag).
+ (NSString *)UnicodeCStrToUnicode:(const char *)cStr withLen:(int)len;




@end

구글 코드 링크 주소 (업데이트됨): http://code.google.com/p/iphone-common-codes-ccteam/source/browse/trunk/CCFC/files/CCEncoding.h

좋은 웹페이지 즐겨찾기