bugGNUstep - Bugs: bug #25233, unable to create an NSString from...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #25233: unable to create an NSString from the Unicode character 0xFFFF

Submitted by:  Doug Simons <theeggcamefirst>
Submitted on:  Fri 02 Jan 2009 10:46:25 PM UTC  
 
Category: Base/FoundationSeverity: 3 - Normal
Item Group: BugStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Sat 03 Jan 2009 07:30:33 AM UTC, comment #1:

0xFFFF is a noncharacter (see http://www.unicode.org/versions/Unicode5.0.0/ch16.pdf section 7).

You can use it in your code, but must not attempt to transfer it to other code (such as an NSString) as that's specifically disallowed by the unicode standard.

You should probably raise a bug report with Apple if their implementation treats a noncharacter as a character, as this is not in conformance with the unicode standard.

In practical terms, it's a very very good thing for NSString to disallow noncharacters as this ensures that bad input is detected early on and that your code does not output bad data or pass bad data to other libraries with unpredictable results.

Richard Frith-Macdonald <CaS>
Project Member
Fri 02 Jan 2009 10:46:25 PM UTC, original submission:

Calling [[NSString alloc] initWithCharacters:&keyCode length:1] returns nil when keyCode is 0xFFFF. A quick look in the code shows that it treats this code and 3 others as non-characters, which may be correct in some contexts. But Cocoa allows creating an NSString containing only this character.

This is a low priority for me, as I've worked around it in my code now, but may be something to look into someday.

Doug Simons <theeggcamefirst>

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by CaS (Posted a comment)
  • -unavailable- added by theeggcamefirst (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 03 Jan 2009 07:30:33 AM UTCCaSStatusNone=>Invalid
      Open/ClosedOpen=>Closed

    Back to the top


    Powered by Savane 3.1-cleanup1