Convert special character like $ to hexadecimal [closed] - iphone

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
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.

Related

Transliteration issue [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 9 years ago.
La> ila>ha illAlla>hu wah}dahu> la> shari>ka lahu, lahul mulku wa lahul h}amdu, wa huwa ‘ala> kulli shai’in nadir.
This is transliteration of ayah. The font used is Times New Arabic . After applying this font i didn't see any changes.Characters like ">" didn't disappears. any solution?
use
NSString *ayah = #"La> ila>ha illAlla>hu wah}dahu> la> shari>ka lahu, lahul mulku wa lahul h}amdu, wa huwa ‘ala> kulli shai’in kadir.";
ayah = [ayah stringByReplacingOccurrencesOfString:#">"
withString:#""];
ayah = [ayah stringByReplacingOccurrencesOfString:#"}"
withString:#""];

ASCII decoding in ios [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
Can anyone decode ascii value in iOS?
I can decode single character value but more than one character i cant decode
Thanks in advance.
This is my string value
<?xml version=\"1.0\" encoding=\"UTF-8\" ?><prestashop></prestashop>
the ascii encoded value is
62651221111103412010311611710711311263365148503634103112101113102107112105633687‌​867247583634656462114116103117118991171061131146462491141161031171189911710611311‌​464
ascii is just a string encoding
you only need to have this:
NSData *ascii = ... //asci data
NSString *string = [[NSString alloc] initWithData:ascii encoding:NSASCIIStringEncoding];
or
char *cStringInAscii = "lalalalasada";
NSString *string = [NSString stringWithCString:cStringInAscii encoding:NSASCIIStringEncoding];

url decode for unicode [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 11 years ago.
How can I decode unicode characters from an URL?. I specified response.charset="UTF-8" in my request, and I received unicode characters like %e3%81%a4%e3%82%8c%e3%. How can I convert these to something I can display on my form?
RFC 3986 specifies how to interpret this. You first decode the percent-escaped byte values in the standard way. Then you interpret the byte stream as UTF-8 to reconstruct the characters. You can find more information here.

How does one decode Base64? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 10 years ago.
As seen here, they have the line ZG9udGJlYWhhdGVyc3RhcnR1cCtoYWNrZXJuZXdzQGdtYWlsLmNvbQ==.
How would one go about decoding this line of Base64?
Base64-decode it. For example, put it in this online decoder: http://www.opinionatedgeek.com/dotnet/tools/base64decode/
BTW this is not encryption, it's encoding.
This is a simple base64 encoding, one way to decode it is to use openssl
echo 'ZG9udGJlYWhhdGVyc3RhcnR1cCtoYWNrZXJuZXdzQGdtYWlsLmNvbQ==' | openssl base64 -d
Use a base64 decoder. Or - specify a language you would like to use and I can give you some example code.
BTW: I decoded this using this online decoder:
http://www.convertstring.com/EncodeDecode/Base64Decode
It decodes to
dontbeahaterstartup+hackernews#gmail.com
Base64 encoding is explained here: Base64 decoder
ZG9udGJlYWhhdGVyc3RhcnR1cCtoYWNrZXJuZXdzQGdtYWlsLmNvbQ== => dontbeahaterstartup+hackernews#gmail.com

Why are there two slashes - forward and backward? [closed]

It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center.
Closed 12 years ago.
I'm totally confused which one to use and when, first thing I do when something goes wrong in code with a slash is replace the one with other so my test cases double with one for / and one for \ .Help me to get the logic behind slashes.
From the wikipedia article about the backslash:
Bob Bemer introduced the \ character
into ASCII, on September 18, 1961, as
the result of character frequency
studies. In particular the \ was
introduced so that the ALGOL boolean
operators "∧" (AND) and "∨" (OR) could
be composed in ASCII as "/\" and "/"
respectively.[4] Both these operators
were included in early versions of the
C programming language supplied with
Unix V6 , Unix V7 and more currently
BSD 2.11.
/ is generally used to denote division as in 10/2 meaning 10 divided by 2. \ is generally used as an escape character as in \t or \n representing a tab and a newline character respectively.
There's nothing like a "forward slash". There's a "slash" / and a "backslash" \.
There's a long and IMHO ilarious discussion about that on the xkcd forum
One More Thing....
The Forward Slash / is Used in *nix To Navigate to the Filesystem...
Like .... /root/home/vs4vijay
and The BackSlash \is Used In Windows ...
Like ..... F:\Games\CounterStrike