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

Re: NSString vs. encoding


  • Subject: Re: NSString vs. encoding
  • From: Johan Kool <email@hidden>
  • Date: Wed, 16 Sep 2009 22:55:01 -0700


Op 16 sep 2009, om 22:14 heeft Joar Wingfors het volgende geschreven:


On 16 sep 2009, at 21.38, Johan Kool wrote:

I am parsing the output of a command line utility (mtree).

Is mtree using strvis perhaps? Google seems to suggest that, but I'm not sure if that's true, or still true. If you're using an open source utility, it should be possible for you to figure out what they're doing, so that you can do the same thing, and not have to reinvent the wheel.


Thanks so much!! That is indeed the case! I now use strunvis and it's all done in just 4 lines of code. (Well, except that I should still handle a returned error code.)

int len = [stringA lengthOfBytesUsingEncoding:NSUTF8StringEncoding];
char dst[len];
strunvis(&dst, [stringA UTF8String]);
return [NSString stringWithUTF8String:dst];


Thank you!

Johan

---
http://www.johankool.nl/

KOOLISTOV - Software for Mac and iPhone
http://www.koolistov.net/




_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSString vs. encoding
      • From: Andrew Farmer <email@hidden>
References: 
 >Re: NSString vs. encoding (From: Greg Guerin <email@hidden>)
 >Re: NSString vs. encoding (From: Johan Kool <email@hidden>)
 >Re: NSString vs. encoding (From: Joar Wingfors <email@hidden>)
 >Re: NSString vs. encoding (From: Johan Kool <email@hidden>)
 >Re: NSString vs. encoding (From: Joar Wingfors <email@hidden>)

  • Prev by Date: Re: How to create subentity object inheriting from superentity object in core data
  • Next by Date: Send POST data to browser
  • Previous by thread: Re: NSString vs. encoding
  • Next by thread: Re: NSString vs. encoding
  • Index(es):
    • Date
    • Thread