• 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
How would you convert a \r to its UTF-8 counterpart ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How would you convert a \r to its UTF-8 counterpart ?


  • Subject: How would you convert a \r to its UTF-8 counterpart ?
  • From: Stéphane Sudre <email@hidden>
  • Date: Tue, 25 Jul 2006 23:20:19 +0200

Let's say I want to save the following string in a .plist file:

"this is a stupid line of text, isn't it?\r"

and the resulting .plist shall be something like this:

<I don't remember the plist header so this is a replacement>
<dict>
	<key>A string</key>
	<string> this is a stupid line of text, isn't it?&#x0D;</string>
</dict>
</I should remember them though>

The idea being to have the \r character be replaced by its hexa value.

If I save a NSDictionary using the writeToFile:atomically: API, I will get a '\r'.

If I replace the \r with &#x0D;, I will get &amp;#x0D; of course.

Any idea on how to do this?

_______________________________________________
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


  • Follow-Ups:
    • Re: How would you convert a \r to its UTF-8 counterpart ?
      • From: Shawn Erickson <email@hidden>
    • Re: How would you convert a \r to its UTF-8 counterpart ?
      • From: Ricky Sharp <email@hidden>
  • Prev by Date: Re: Why did I prefix the key of an NSSortDescriptor with "@"?
  • Next by Date: Re: How would you convert a \r to its UTF-8 counterpart ?
  • Previous by thread: Re: Why did I prefix the key of an NSSortDescriptor with "@"?
  • Next by thread: Re: How would you convert a \r to its UTF-8 counterpart ?
  • Index(es):
    • Date
    • Thread