mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
[XPbOwner xSelectionNotify:] and [XPbOwner xProvideSelection:]
explicit conversion of transferd strings from/to NSISOLatin1StringEncoding. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@17229 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
71cd037415
commit
a08ee18c50
1 changed files with 14 additions and 5 deletions
19
Tools/xpbs.m
19
Tools/xpbs.m
|
@ -804,8 +804,13 @@ xErrorHandler(Display *d, XErrorEvent *e)
|
|||
NSData *d;
|
||||
NSString *s;
|
||||
|
||||
s = [NSString stringWithCString: data];
|
||||
d = [[NSData alloc] initWithBytes: (void*)data
|
||||
length: number_items];
|
||||
s = [[NSString alloc] initWithData: d
|
||||
encoding: NSISOLatin1StringEncoding];
|
||||
RELEASE(d);
|
||||
d = [NSSerializer serializePropertyList: s];
|
||||
RELEASE(s);
|
||||
[self setData: d];
|
||||
}
|
||||
else
|
||||
|
@ -959,12 +964,16 @@ xErrorHandler(Display *d, XErrorEvent *e)
|
|||
if ([osType isEqualToString: NSStringPboardType])
|
||||
{
|
||||
NSString *s = [_pb stringForType: NSStringPboardType];
|
||||
NSData *d = [s dataUsingEncoding: NSISOLatin1StringEncoding];
|
||||
|
||||
format = 8;
|
||||
numItems = [s cStringLength];
|
||||
data = malloc(numItems + 1);
|
||||
if (data)
|
||||
[s getCString: data];
|
||||
if (d != nil)
|
||||
{
|
||||
numItems = [d length];
|
||||
data = malloc(numItems + 1);
|
||||
if (data)
|
||||
[d getBytes: data];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue