Locale-Sensitive Objective-C Method
Foundation NSString
NSString writeToFile:atomically:encoding:error
Internationalization (I18n) Method Overview
Writing a file with a set string.
Click here
for additional Apple Developer Documentation details.
I18n Issues
Use of an explicit (non-Unicode) encoding may cause problems when later moving to a multilingual environment.
Resolution: Adopt UTF-8 or UTF-16 as the encoding.
Note: This method stores the specified encoding with the file in an extended attribute under the name
com.apple.TextEncoding. The value contains the IANA name for the encoding and the CFStringEncoding value
for the encoding, separated by a semicolon. The methods initWithContentsOfFile:usedEncoding:error:,
initWithContentsOfURL:usedEncoding:error:, stringWithContentsOfFile:usedEncoding:error:,
and stringWithContentsOfURL:usedEncoding:error: use this information to open the file using the right
encoding.
Generally one needs to pass in locale , encoding or language to ensure
that any culture-dependent conversion is done properly.
If you determine that the call is i18n-safe, you can use Globalyzer's
Ignore Comment functionality to ensure that it isn't
picked up in a subsequent scan.
For information about Objective-C Internationalization, click here.
|