• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa text services handling of malformed Unicode
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa text services handling of malformed Unicode


  • Subject: Re: Cocoa text services handling of malformed Unicode
  • From: Aki Inoue <email@hidden>
  • Date: Tue, 28 Jan 2003 00:29:32 -0800

John

CF/NSString refuses to interpret illegal UTF-8 sequences in order to conform to the Unicode standard. The standard added more tighter definition of UTF-8 to prevent possible security holes.

So, it is actually shame that no existing browsers are following this standard.

Aki

On 2003.1.27, at 10:52 PM, John Scalo wrote:

Hi,

I have a web URL that contains UTF-8 data. Normally, this data is accepted
without problems by a call such as

dataStr = [[NSString alloc] initWithData:data
encoding:NSUTF8StringEncoding];

but recently this same call started returning nil. My guess is that an
invalid combination of bytes appeared on that page and Cocoa text services
now bails on it. I've tried other encodings but either get garbage or nil.
Adding a <http-equiv="Content-Type" content="text/html; charset=utf-8"> meta
tag doesn't help.

Questions-
Does Cocoa really bail on encoding a huge amount of data which only contains
a few "bad" bytes? Seems it would be more helpful to at least make a guess.

I manage this page, but the data is dynamic (it's a php script that formats
high scores from a SQL database). Is there some way that I can determine
which string is "bad", assuming that's the case, so I can remove it (and
only it)?

A Cocoa web browser displays the string encoded data ok. Assuming it's using
Cocoa, why is it successful when my code fails?

For the curious, the page is
http://lumacode.com/simon/simon_formatted_top100.php?vers=1100

(this is for the game Simon Extreme, http://lumacode.com/simon, source code
available)

Thanks
John
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Cocoa text services handling of malformed Unicode (From: John Scalo <email@hidden>)

  • Prev by Date: Buggy cvs-wrap
  • Next by Date: Re: Drawing gradients in views
  • Previous by thread: Cocoa text services handling of malformed Unicode
  • Next by thread: nscolumn title redrawing
  • Index(es):
    • Date
    • Thread