mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
Check if encodstr is not nil
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@14833 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3a835d9182
commit
d732f07c68
1 changed files with 4 additions and 4 deletions
|
@ -325,7 +325,7 @@ NSStringEncoding *GetAvailableEncodings()
|
|||
* for the iso8859-5 character set, the registry is iso8859 and
|
||||
* the encoding is 5, and the returned NSStringEncoding is
|
||||
* NSISOCyrillicStringEncoding. If there is no specific encoding,
|
||||
* use @"0".
|
||||
* use @"0". Returns GSUndefinedEncoding if there is no match.
|
||||
*/
|
||||
NSStringEncoding
|
||||
GSEncodingForRegistry (NSString *registry, NSString *encoding)
|
||||
|
@ -406,7 +406,7 @@ GSEncodingForRegistry (NSString *registry, NSString *encoding)
|
|||
return NSUTF8StringEncoding;
|
||||
}
|
||||
|
||||
return NSASCIIStringEncoding;
|
||||
return GSUndefinedEncoding;
|
||||
}
|
||||
|
||||
/** Try to deduce the string encoding from the locale string
|
||||
|
@ -454,8 +454,6 @@ GSEncodingFromLocale(const char *clocale)
|
|||
}
|
||||
|
||||
encoding = GSEncodingForRegistry(registry, encodstr);
|
||||
if (encoding == NSASCIIStringEncoding)
|
||||
encoding = GSUndefinedEncoding;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -473,6 +471,8 @@ GSEncodingFromLocale(const char *clocale)
|
|||
dict = [NSDictionary dictionaryWithContentsOfFile: table];
|
||||
encodstr = [dict objectForKey:
|
||||
[NSString stringWithCString: clocale]];
|
||||
if (encodstr == nil)
|
||||
return GSUndefinedEncoding;
|
||||
|
||||
/* Find the matching encoding */
|
||||
count = 0;
|
||||
|
|
Loading…
Reference in a new issue