0

Is there any way to uuencode data in the iPhone SDK? An API call or perhaps a library?

Benjamin Pollack
  • 27,594
  • 16
  • 81
  • 105
luvieere
  • 37,065
  • 18
  • 127
  • 179

2 Answers2

1

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.

Sixten Otto
  • 14,816
  • 3
  • 48
  • 60
1

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.

Ramin
  • 13,343
  • 3
  • 33
  • 35