discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString lowercaseString


From: Sebastian Reitenbach
Subject: Re: NSString lowercaseString
Date: Fri, 03 Aug 2012 19:21:20 +0200
User-agent: SOGoMail 1.3.17

On Thursday, August 2, 2012 11:48 CEST, Richard Frith-Macdonald 
<richard@tiptree.demon.co.uk> wrote:

>
> On 1 Aug 2012, at 19:04, Sebastian Reitenbach wrote:
>
> > Hi,
> >
> > On Wednesday, August 1, 2012 18:00 CEST, "Sebastian Reitenbach" 
> > <sebastia@l00-bugdead-prods.de> wrote:
> >
> > On the Apple documentation I found -[NSString lowercaseStringWithLocale:] 
> > bug GNUstep doesn't seem to have that.
> > When it would be available, would that maybe help me?
>
> I've kept out of this because I don't have an easy answer ... I'm not even 
> sure what the problem is  (or more likely, problems are).
>
> However, it doesn't appear that anyone else has spotted anything simple 
> either, and while we don't understand the problem, it seems premature to be 
> looking for a new method to provide the solution.
>
> So, can I please suggest looking at this slowly and systematically.
>
> It seems possible to me that there are are a variety of areas where a problem 
> may be, probably four main ones:
>
> 1. what is the compiler putting into the binary?
> 2. how is base interpreting what it finds?
> 3. how is the case conversion being done?
> 4. is there a problem logging it?
>
> The way to find all this out is by stepping through the executable in gdb and 
> examining what you find there.
>
> If you debug the test program setting a break point immediately before the 
> literal string is used, you can step into the methods.
>
> eg. for       NSString *l = [@"TöÖst" lowercaseString];
> you can step into the lowercaseString method and look at the receiver and see 
> what class it is, and look  at the underlying character data in the literal 
> string and see whether the compiler has actually generated UTF-8
> you can then step through and see how characters are being converted to  
> lowercase etc.
> Is the lowercaseString implementation from the base NSString class the one 
> being used?
> Is the uni_tolower() function working?
> and so on.
>
>

So far I only tried to debug the version on OpenBSD, because there I have the 
OGo problem. On the Linux box, there I also have an older version installed 
maybe,
and therefore and cannot easily upgrade, to make it better comparable. The 
thing I just recognized, is on Linux I get:
2012-08-01 08:49:57.974 lowercase[16574] autorelease called without pool for 
object (0x72dce8) of class GSCInlineString in thread <NSThread: 0x6b0cc8>
 and on OpenBSD:
2012-08-01 10:38:52.851 lowercase[5483] autorelease called without pool for 
object (0x209c1c5c8) of class GSUnicodeInlineString in thread <NSThread: 
0x20750be08>
the difference of the GSCInlineString vs. GSUnicodeInlineString


 - (NSString *)_formatForStringValue:(id)_value {
  const char *uchar = [_value UTF8String];
  NSString *value = [NSString stringWithUTF8String:uchar];
NSLog(@"LSBaseSearch.m: _formatForStringValue: _value: %@ value: %@, lowercase: 
%@ description: %@", _value, value, [value lowercaseString], [value className])
;
  return [value lowercaseString];
}


2012-08-03 18:58:22.871 ogo-webui[15455] LSBaseSearch.m: _formatForStringValue: 
_value: %%ö%% value: %%ö%%, lowercase: %%%% description: GSCInlineString
2012-08-03 18:58:22.871 ogo-webui[15455] LSBaseSearch.m: _formatForStringValue: 
_value: %%ö%% value: %%ö%%, lowercase: %%%% description: GSCInlineString
2012-08-03 18:58:22.871 ogo-webui[15455] LSBaseSearch.m: _formatForStringValue: 
_value: %%ö%% value: %%ö%%, lowercase: %%%% description: GSCInlineString
2012-08-03 18:58:22.872 ogo-webui[15455] LSBaseSearch.m: _formatForStringValue: 
_value: %%ö%% value: %%ö%%, lowercase: %%%% description: GSCInlineString

But with OGo I seem to end up in GSCInlineString instead of 
GSUnicodeInlineString.
With gdb I see I end up in -[GSCString lowercaseString], and not in -[NSString 
lowercaseString].
However, with the test program lowercase2.m for example, I end up in -[NSString 
lowercaseString]. As you can see in the short example above, I tried various 
ways,
above shown is not the only one I tried, to get into -[NSString lowercase], or 
get this GSUnicodeInlineString.
Is there a way to end up in NSStrings lowercaseString?

thanks,
Sebastian





reply via email to

[Prev in Thread] Current Thread [Next in Thread]