mirror of
https://github.com/gnustep/libs-back.git
synced 2025-04-22 15:31:14 +00:00
Minor fixup for getting encoding from charset.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@23992 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
d72094d9e5
commit
d180234a4d
2 changed files with 16 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
|||
2006-10-29 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
* Source/xlib/XGFont.m: Use encodingFromCharset (undeprecated and
|
||||
handles more cases than GSEncodingForRegistry)
|
||||
|
||||
2006-10-28 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* back.make.in: Use correct flags;
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
#include <Foundation/NSData.h>
|
||||
#include <Foundation/NSValue.h>
|
||||
// For the encoding functions
|
||||
#include <GNUstepBase/GSMime.h>
|
||||
#include <GNUstepBase/Unicode.h>
|
||||
|
||||
static Atom XA_SLANT = (Atom)0;
|
||||
|
@ -319,11 +320,16 @@ static BOOL XGInitAtoms(Display *dpy)
|
|||
|
||||
if (enc != nil)
|
||||
{
|
||||
mostCompatibleStringEncoding = GSEncodingForRegistry(reg, enc);
|
||||
if (mostCompatibleStringEncoding == GSUndefinedEncoding)
|
||||
mostCompatibleStringEncoding = NSASCIIStringEncoding;
|
||||
encodingScheme = [NSString stringWithFormat: @"%@-%@",
|
||||
reg, enc];
|
||||
if ([enc length] != 0 && [enc isEqualToString: @"0"] == NO)
|
||||
{
|
||||
encodingScheme = [NSString stringWithFormat: @"%@-%@", reg, enc];
|
||||
}
|
||||
else
|
||||
{
|
||||
encodingScheme = reg;
|
||||
}
|
||||
mostCompatibleStringEncoding
|
||||
= [GSMimeDocument encodingFromCharset: encodingScheme];
|
||||
NSDebugLog(@"Found encoding %d for %@",
|
||||
mostCompatibleStringEncoding, encodingScheme);
|
||||
RETAIN(encodingScheme);
|
||||
|
|
Loading…
Reference in a new issue