3
NSString *searchString = @"Lyngbø";
NSLog("%@",[searchString stringByAddingPercentEscapeUsingEncoding:NSUTF8StringEncoding]);

This gives me : Lyng%C3%B8

<script type="text/javascript">
document.write(escape("Lyngbø"));
</script> 

This gives me : Lyngb%F8

The web search engine i am developing against doesnt understand the Objectiv C's way of encoding the string, and returns nothing when searching for words that contains either æ. ø or å

1 Answer 1

6

Charset difference. Instead of NSUTF8StringEncoding, use NSISOLatin1StringEncoding.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.