Oolite 1.91.0.7645-241119-222d325
Loading...
Searching...
No Matches
OOEncodingConverter.m File Reference
+ Include dependency graph for OOEncodingConverter.m:

Go to the source code of this file.

Classes

category  OOEncodingConverter(Private)
 

Macros

#define USE_COMPATIBILITY_MAPPING   0
 
#define PROFILE_ENCODING_CONVERTER   0
 
#define kWindowsLatin1Str   @"windows-latin-1"
 
#define kWindowsLatin2Str   @"windows-latin-2"
 
#define kWindowsCyrillicStr   @"windows-cyrillic"
 
#define kWindowsGreekStr   @"windows-greek"
 
#define kWindowsTurkishStr   @"windows-turkish"
 

Functions

NSString * StringFromEncoding (NSStringEncoding encoding)
 
NSStringEncoding EncodingFromString (NSString *name)
 

Variables

static const NSUInteger kCachePruneThreshold = 200
 

Macro Definition Documentation

◆ kWindowsCyrillicStr

#define kWindowsCyrillicStr   @"windows-cyrillic"

Definition at line 219 of file OOEncodingConverter.m.

Referenced by OOEncodingConverter::convertString:, and StringFromEncoding().

◆ kWindowsGreekStr

#define kWindowsGreekStr   @"windows-greek"

Definition at line 220 of file OOEncodingConverter.m.

Referenced by OOEncodingConverter::convertString:, and StringFromEncoding().

◆ kWindowsLatin1Str

#define kWindowsLatin1Str   @"windows-latin-1"

Definition at line 217 of file OOEncodingConverter.m.

Referenced by OOEncodingConverter::convertString:, and StringFromEncoding().

◆ kWindowsLatin2Str

#define kWindowsLatin2Str   @"windows-latin-2"

Definition at line 218 of file OOEncodingConverter.m.

Referenced by OOEncodingConverter::convertString:, and StringFromEncoding().

◆ kWindowsTurkishStr

#define kWindowsTurkishStr   @"windows-turkish"

Definition at line 221 of file OOEncodingConverter.m.

Referenced by OOEncodingConverter::convertString:, and StringFromEncoding().

◆ PROFILE_ENCODING_CONVERTER

#define PROFILE_ENCODING_CONVERTER   0

Definition at line 48 of file OOEncodingConverter.m.

◆ USE_COMPATIBILITY_MAPPING

#define USE_COMPATIBILITY_MAPPING   0

Definition at line 42 of file OOEncodingConverter.m.

Function Documentation

◆ EncodingFromString()

NSStringEncoding EncodingFromString ( NSString * name)

Definition at line 249 of file OOEncodingConverter.m.

250{
251 if ([name isEqualToString:kWindowsLatin1Str]) return NSWindowsCP1252StringEncoding;
252 if ([name isEqualToString:kWindowsLatin2Str]) return NSWindowsCP1250StringEncoding;
253 if ([name isEqualToString:kWindowsCyrillicStr]) return NSWindowsCP1251StringEncoding;
254 if ([name isEqualToString:kWindowsGreekStr]) return NSWindowsCP1253StringEncoding;
255 if ([name isEqualToString:kWindowsTurkishStr]) return NSWindowsCP1254StringEncoding;
256 return (NSStringEncoding)NSNotFound;
257}
#define kWindowsCyrillicStr
#define kWindowsLatin1Str
#define kWindowsLatin2Str
#define kWindowsGreekStr
#define kWindowsTurkishStr

◆ StringFromEncoding()

NSString * StringFromEncoding ( NSStringEncoding encoding)

Definition at line 224 of file OOEncodingConverter.m.

225{
226 switch (encoding)
227 {
228 case NSWindowsCP1252StringEncoding:
229 return kWindowsLatin1Str;
230
231 case NSWindowsCP1250StringEncoding:
232 return kWindowsLatin2Str;
233
234 case NSWindowsCP1251StringEncoding:
235 return kWindowsCyrillicStr;
236
237 case NSWindowsCP1253StringEncoding:
238 return kWindowsGreekStr;
239
240 case NSWindowsCP1254StringEncoding:
241 return kWindowsTurkishStr;
242
243 default:
244 return nil;
245 }
246}
return nil

References kWindowsCyrillicStr, kWindowsGreekStr, kWindowsLatin1Str, kWindowsLatin2Str, kWindowsTurkishStr, and nil.

Variable Documentation

◆ kCachePruneThreshold

const NSUInteger kCachePruneThreshold = 200
static

Definition at line 51 of file OOEncodingConverter.m.