Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Convert unicode string into ascii



this is a cool idea.
mapping into an array all the chars I need and run the parse..
quite cool.tnx!
I need to call the parse only one time after loaded the .prg C64 file.


Maybe I'm missing something from your example, previous postings, and my ISP's web mail client, but it appears your desired output doesn't seem to match in character count to your original text. Nevertheless, if all you want is to turn low-ASCII (values less than 0x20) and high-ASCII (values greater than 0x7F) into period characters, you'd find better performance and flexibility for your particular needs by simply writing a function that takes an unsigned 8-bit integer (e.g., in a loop, 0x01, 0x08, 0x0B, ..., 0x13) and returns the desired character. In that function, do your test for low-ASCII and high-ASCII, returning the period character in those cases, and the supplied character in all other cases. Since this code is pretty trivial, you could even inline it rather than code it into a separate function, but I don't know if you need to call it in more than one place in your code.
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >RE: Convert unicode string into ascii (From: "Gary L. Wade" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.