Questions tagged [nsstringencoding]

Enumeration in Objective-C Cocoa API that contains type for string encoding

Enumeration in Objective-C Cocoa API that contains type for string encoding

127 questions
0
votes
2 answers

Using the right encoding with NSString

I got unicode text from a website and saved it to a NSString, the problem is that the text in the string is not encoded correctly so I see only symbols. The text on the website is mainly Hebrew Characters. NSLog(@"%@", [trafficNodes[0]…
oridahan
  • 574
  • 1
  • 7
  • 20
0
votes
0 answers

does it have a function that change all NSStringEncoding into NSUTF8StringEncoding

i want to download html code and save it to a html file.However, there are kinds of Encoding which are used into html files,such as NSUTF8StringEncoding,NSISOLatin1StringEncoding and so on. wethere it has a function that change the different files…
gohamgx
  • 273
  • 2
  • 16
0
votes
1 answer

ios stringByAddingPercentEscapesUsingEncoding convert not corrected

I have some content like 2ofsjw0234lnc.jpg\t2m03fcsmaokwf.jpg\n want to encode as a url Parameter,so I use code like bellowed. NSString * attachsString = [_attachments stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; the output is…
alians
  • 3
  • 3
0
votes
1 answer

NSString cannot decode class version XXXX

I'm implementing my own keyed NSCoder subclass and decoding is failing for an NSString. If I do something like the following: MyUnarchiver *aDecoder = [[MyUnarchiver alloc] initWithData:someArchivedData]; NSString *aString = [[NSString alloc]…
Ncat
  • 417
  • 3
  • 10
0
votes
1 answer

MySQL to PHP to NSData to NSString - Where has my UTF8 encoding gone wrong?

I'm trying to write a simple PHP web service as a bridge between a MySQL database on my web server and an Objective-C Cocoa desktop app. Every link in the chain is working in UTF-8, as best as I can tell, but I can't seem to get the non-standard…
chapka
  • 490
  • 1
  • 3
  • 11
0
votes
3 answers

Converting two double values to String and then making a string using the new strings

I am trying to convert two values to string and then make a new string containing the ones i made earlier so my service can accept them. NSString *string1 = [ NSString stringWithFormat:@"%f", locationController.dblLatitude]; NSString *string2 = […
0
votes
1 answer

Casting NSString to NSData

Is there any way to store a NSString in a NSData maintaining the SAME data? Example (this is fine, but it's not what I need): NSString *tmpString = @"Hello World!"; NSData *nsdataString = [tmpString dataUsingEncoding:NSUTF8StringEncoding]; I…
ndman
  • 153
  • 8
0
votes
0 answers

NSString encoding. How to get string with the same encoding as after copying from Xcode console?

Briefly: My xml string is with wrong encoding. But after using NSLog and copying string from Xcode console the string got right encoding. Full explanation: I sent xml string to server with ASIFormDataRequest and encoding:
0
votes
1 answer

NSString encoding issue

I have xml string. It's wrong string. But after using NSLog and coping it from console, it became good string (I got good response from server). I build wrong string by this way: NSString *soapMessage = [NSString stringWithFormat:@"
Paul T.
  • 4,938
  • 7
  • 45
  • 93
0
votes
1 answer

Is it possible to test if a text file can be loaded with a NSStringEncoding without actually loading it?

I'm working on an app that handles text files. On the open dialog accessory view, when the user choses a file I want to display on a NSPopUpButton the supported encodings for the selected file, but so far the only way I could find to test if a file…
0
votes
1 answer

How can I tell the NSStringEncoding from NSData?

I have NSData from +[NSJSONSerialization dataWithJSONObject:options:error:]. How is the data encoded?
0
votes
1 answer

NSRegularExpression match is not working

I'm trying to replace some escaped unicode in an NSString. I haven't had any luck with the CFString functions, so I thought I would try regular expressions. Here is the regex NSRegularExpression *regexUnicode2 = [NSRegularExpression…
Jim
  • 5,940
  • 9
  • 44
  • 91
0
votes
1 answer

Detecting custom url schemes from user typed in web address

I was trying out the tutorial of building a simple web browser using UIWebView. In which there is feature to prefix the scheme "http://" to the url if user just types in the address without any scheme. For Ex: user types in google.com instead of…
user1150393
  • 139
  • 1
  • 15
0
votes
2 answers

Using unicode characters on NSString

I am having trouble using a NSString with unicode characters like 'ç' and 'ñ'. An example as simple as this: NSString *alphabet = @"abçd"; NSLog(@"alphabet is %@", alphabet); outputs this on the console: alphabet is ab√ßd How can I ensure that…
Rafael
  • 368
  • 1
  • 4
  • 22
-1
votes
2 answers

want to have this string "مرحبا Hello" save it to database and display back to uilabel

I am looking for solution where i want to store English + Arabic + Emoji Character to store to Database and retrieve it back while display. Below is the code what i have used to support Emoji, after that Arabic text is not showing. +(NSString…
Maheta Dhaval K
  • 764
  • 6
  • 19
1 2 3
8
9