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

Re: unichar question


  • Subject: Re: unichar question
  • From: Ondra Cada <email@hidden>
  • Date: Tue, 2 Apr 2002 13:51:51 +0200

On Tuesday, April 2, 2002, at 07:11 , Isaac Sherman wrote:

How would I go about converting a unichar to a char?

You can't without losing information, that's obvious.

If you wanna lose information (which should be always considered from the other languages' POV!!!!) then the way is

const char *cp=[[aString dataUsingEncoding:NSASCIIEncoding allowLossyConversion:YES] bytes];

I want to cypher text,
for instance, change ABC to XRQ, and I'm not finding a good way to do it
with NSString.

What's wrong with characterAtIndex: and computing unichars directly?

I don't think NSScanner will help, but maybe I misread it?

I guess the latter. At least, I don't know how NSScanner would help with char-by-char work.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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: 
 >unichar question (From: Isaac Sherman <email@hidden>)

  • Prev by Date: Re: Shared objects and other data
  • Next by Date: Re: unichar question
  • Previous by thread: unichar question
  • Next by thread: Re: unichar question[SOLVED]
  • Index(es):
    • Date
    • Thread