You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

89 lines
1.7 KiB

3 years ago
/*!
* \~chinese
* @header PTEncode.h
* @abstract
*
* \~english
* @header PTEncode.h
* @abstract Coding and decoding
*/
#import <Foundation/Foundation.h>
@interface PTEncode : NSObject
/*!
* \~chinese
* GBK
*
* @param string
*
* @return
*
* \~english
* Encodedefault:GBK
*
* @param string String to be encoded
*
* @return Encoded data
*/
+ (NSData *)encodeDataWithString:(NSString *)string;
/*!
* \~chinese
* ,default:GBK
*
* @param data
*
* @return
*
* \~english
* Decoding,default:GBK
*
* @param data Data to be decoded
*
* @return Decoded data
*/
+ (NSString *)decodeStringWithData:(NSData *)data;
/*!
* \~chinese
*
*
* @param string
* @param encodeType
*
* @return
*
* \~english
* Support various encoding.
*
* @param string String to be encoded
* @param encodeType Encode type
*
* @return Encoded data
*/
+ (NSData *)encodeDataWithString:(NSString *)string encodingType:(CFStringEncodings)encodeType;
/*!
* \~chinese
*
*
* @param data
* @param encodeType
*
* @return
*
* \~english
* Support various decoding.
*
* @param data Data to be decoded
* @param encodeType Encode type
*
* @return Decoded data
*/
+ (NSString *)decodeDataWithString:(NSData *)data encodingType:(CFStringEncodings)encodeType;
@end