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:
search nsstringencoding
Comments
Post a Comment