mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Simplify conversion of a string to data (use base class code) and fix to handle the insertion of BOM consistently (as on OSX) for encodings where the byte order matters but is not specified by the encoding.
This commit is contained in:
parent
9aa17b452c
commit
bd5f2909e6
3 changed files with 31 additions and 171 deletions
|
@ -482,6 +482,10 @@ GS_EXPORT_CLASS
|
|||
// Working With Encodings
|
||||
- (BOOL) canBeConvertedToEncoding: (NSStringEncoding)encoding;
|
||||
- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding;
|
||||
/** Conversion to an encoding where byte order matters but is not specified
|
||||
* (NSUnicodeStringEncoding, NSUTF16StringEncoding, NSUTF32StringEncoding)
|
||||
* produces data with a Byte Order Marker (BOM) at the start of the data.
|
||||
*/
|
||||
- (NSData*) dataUsingEncoding: (NSStringEncoding)encoding
|
||||
allowLossyConversion: (BOOL)flag;
|
||||
+ (NSStringEncoding) defaultCStringEncoding;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue