is a way to convert an unicode string into a simple a-z>0-9 string
and replace the other wierd chars into a "." (full stop)?

im doing a small hex reader, so maybe this could help you.

CFDataRef CFStringCreateExternalRepresentation (
   CFAllocatorRef alloc,
   CFStringRef theString,
   CFStringEncoding encoding,
   UInt8 lossByte
);
-- OR --
CFIndex CFStringGetBytes (
   CFStringRef theString,
   CFRange range,
   CFStringEncoding encoding,
   UInt8 lossByte,
   Boolean isExternalRepresentation,
   UInt8 *buffer,
   CFIndex maxBufLen,
   CFIndex *usedBufLen
);

Pass kCFStringEncodingASCII as the desired encoding, '.' as your loss byte. That won't limit you to purely alphanumerics - it allows spaces, punctuation, etc. But it may be exactly what you want - it's not clear from your original post.

Depending on how you then need to use the result, you may prefer one or the other. In either case it's easy enough to convert back to a CFString if that's what you ultimately need.

Wade
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to