• 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: Best encoding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best encoding


  • Subject: Re: Best encoding
  • From: Scott Anguish <email@hidden>
  • Date: Fri, 8 Jul 2005 04:49:56 -0400


On Jul 8, 2005, at 4:31 AM, Lorenzo wrote:

Hi,
I download some rss files from the web and I read and show the text using


    stringWithContentsOfFile:filePath
                    encoding:NSISOLatin1StringEncoding
                       error:&error

Some rss requires NSISOLatin1StringEncoding, someone else requires
NSUTF8StringEncoding. So my question is: how can I detect what the right
encoding I have to use?


In detail
----------
If I read the file A with NSISOLatin1StringEncoding I see the right text.
If I read the file B with NSISOLatin1StringEncoding I see the wrong text.
So I try to read the file B with NSUTF8StringEncoding and I see the right
text. But if I read the file A with NSUTF8StringEncoding I get a nil
string.



download it and use NSXMLDocument to load it .. then you can get the characterEncoding, assuming it's specified in the file
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden
References: 
 >Best encoding (From: Lorenzo <email@hidden>)

  • Prev by Date: Best encoding
  • Next by Date: append to file (new to Cocoa)
  • Previous by thread: Best encoding
  • Next by thread: Re: Best encoding
  • Index(es):
    • Date
    • Thread