开发者

UUENCODE data in the iPhone SDK

开发者 https://www.devze.com 2022-12-08 01:30 出处:网络
Is there any way to uuencode data i开发者_开发知识库n the iPhone SDK? An API call or perhaps a library?There isn\'t a built-in API to uuencode data, no, but the algorithm is pretty straightforward (th

Is there any way to uuencode data i开发者_开发知识库n the iPhone SDK? An API call or perhaps a library?


There isn't a built-in API to uuencode data, no, but the algorithm is pretty straightforward (the Wikipedia article gives a good overview), and there's plenty of C source code out in the world (here's one example that looks like it's freely available/reusable). Since uuencode operates at the level of bytes, C code should be fine... you can get bytes from an NSData directly, or with NSString methods like UTF8String and cStringUsingEncoding.


If you're trying to convert binary data so you can submit it to a web-site you may want to consider using Base64 (also here) instead.

0

精彩评论

暂无评论...
验证码 换一张
取 消