iphone - Label load with "weird characters" from server -


i have label in view loads plain text file , displays content, displays weird characters not located in .txt file along real content.

the text file has 1 line in : "update submitted"

this looks on actual device itself.

can see, "update submitted" label has 2 weird characters in front of it.

i'm using code :

content = [nsstring stringwithcontentsofurl:[nsurl urlwithstring:@"http://samguichelaar.com/soadstatus.txt"] encoding: 1 error: null]; label1.text = content; 

thanks in advance!

you're using ascii encoding. switch utf8 encoding:

urlwithstring:@"http://samguichelaar.com/soadstatus.txt"] encoding:nsutf8stringencoding error: null] 

also, should use apple provided constants string encoding in case apple ever decides want change value associated of constants:

http://developer.apple.com/library/ios/#documentation/cocoa/reference/foundation/classes/nsstring_class/reference/nsstring.html

search nsstringencoding


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -