开发者

NSURL doesn't work any time

i have the following problem sometimes my openURL-Dialog works perfectly, then i looked at the variable from the url and that is the variable:

www.brehm-gmbh.de

but some other 开发者_开发知识库times there are some crazy elements at the end of the variable like this:

www.adamczyk-fenster.de%E2%80%8E

i get this pages from an .asc file and both are in this file normal without this elements, what can i do to solve this problem?

thank you all for helping beforehand


From Wikipedia:

The left-to-right mark (LRM) is a control character or non-printing character, used in the computerized typesetting of bi-directional text, containing mixed left-to-right scripts (such as English and Russian) and right-to-left scripts (such as Arabic and Hebrew). It is used to change the way adjacent characters are grouped with respect to text direction.

You're getting this because (1) you've got non-English URLs, are composing URLs from non-English strings or you have some other non-English elements and the string encoding is attempting to compensate or (2) it's garbarge being interpreted as an encoding (unlikely if it is consistant.)

Call -[NSString localizedNameOfStringEncoding] on the string before you use it see what encoding it is using. You probably need to explicitly establish an encoding when you read in the strings before you put them in the NSURL.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜