I am working on an iOS application. In this application I am trying to convert NSString to hexadecimal. But in some cases NSString contains special $, ¥, etc. This is where I am facing problem. These characters don't convert to hexadecimal.

Is there any way to convert special characters to hexadecimal?

有帮助吗?

解决方案

Convert the string to NSData

[NSString dataUsingEncoding:]

Then using the data object you can output any base you want: octal, hex, decimal, binary.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top