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
1 answer

How to convert string into NSData to pass it to BLE Device?

I have textField where the user enters any text doesn't know the length even, then I have to convert it to hexadecimal. which I have done it through this code. NSString * str = @"Hello World"; NSString * hexStr = [NSString stringWithFormat:@"%@", …
Jatoi 123
  • 57
  • 6
0
votes
1 answer

Corruption of NSString or encoding issue in Objective C

Please see code below: + (void)splashDataFromJSON:(NSData *)objectNotation error:(NSError **)error { NSError *localError = nil; NSDictionary *parsedObject = [NSJSONSerialization JSONObjectWithData:objectNotation options:0…
Zephyr
  • 11
  • 1
0
votes
0 answers

Escape special characters for creating POST requests

I'm using a third party service QuickBlox to manage a backend of my app. Users can input text and create objects on the backend. However, when I create a POST request to https://api.quickbloc.com/users.json and attempt to send special characters…
0
votes
0 answers

iOS custom chat app not converting Japanese String if greater than 3 character

I am stuck with problem in iOS chat app where we are reading response from webservice as JSON. In Android chat is working fine but not able to succeed in iOS chat app. In my SQL db we have tried all four character sets available…
anil kumar
  • 89
  • 3
  • 8
0
votes
1 answer

Encoding issue reading HTML encoded strings from a SQLite file in iOS

I have a SQLite file that contains a text column which can contain HTML encoded text. For example, it can contain a value like #Sample, which when displayed should be #Sample (# is the HTML encoding for the # symbol). However, when I read…
melsam
  • 4,947
  • 1
  • 22
  • 23
0
votes
1 answer

How to change encoding in Restkit for IOS from Utf8 to Wincp1251

I get response from server in wincp1251 and restkit returns nil to my mapped object strings. I know restKit have a property defaultHTTPEncoding in RKClient(https://github.com/RestKit/RestKit/commit/0ead8a922219ec42ec6dae6ebe59139a1fd589ae), how can…
0
votes
1 answer

Error when comparing NSString generated from NSUTF8StringEncoding

I use my app to receive data by using this method: -(void)udpSocket:(GCDAsyncUdpSocket *)sock didReceiveData:(NSData *)data fromAddress:(NSData *)address withFilterContext:(id)filterContext { NSLog(@"didReceiveData"); NSString* input =…
0
votes
2 answers

How to find and replace a particular unicode character with a non-unicode character in an NSString?

I am being provided a string that may have a unicode apostrophe in it (\u2019) and I must replace it with a standard apostrophe (plain old "'"). I usually use stringByReplacingOccurrencesOfString to do this kind of thing but trying this does not…
Alyoshak
  • 2,696
  • 10
  • 43
  • 70
0
votes
1 answer

Encoding and Decoding Strings using UnsafeMutablePointer in Swift

I'm having trouble converting strings to and from UnsafeMutablePointers. The following code doesn't work, returning the wrong string. // func rfcommChannelData(rfcommChannel: IOBluetoothRFCOMMChannel!, data dataPointer: UnsafeMutablePointer,…
user2844801
  • 1,394
  • 2
  • 12
  • 20
0
votes
1 answer

Incorrect NSStringEncoding value 0x0000 detected in NSURLRequest

I am getting an error when i try to convert NSData to NSString in Swift This is my request : var request = NSURLRequest(URL: url!, cachePolicy: NSURLRequestCachePolicy.ReturnCacheDataElseLoad, timeoutInterval: 200) I am getting the error here : …
AaoIi
  • 8,288
  • 6
  • 45
  • 87
0
votes
1 answer

Prevent NSString to escape contents

Sorry for maybe a newbie question. For various reasons I am stuck with a peculiar string that looks like this: NSString *myString = @"A\\314\\212A\\314\\210O\\314\\210.jpg"; Can I in some ninja-way remove the double \\ and force NSString…
jannej
  • 864
  • 14
  • 26
0
votes
1 answer

iOS filter out characters that cannot be encoded

Hi I am developing an iOS application and I am facing the following question. I have a NSString that contains Traditional Chinese, Simplified Chinese and probably some special characters like "®". When I want to convert this NSString to NSData…
chengsam
  • 7,315
  • 6
  • 30
  • 38
0
votes
1 answer

Finding substring of NSString with RegularExpressions

I'm trying to get the substring from a NSString by using NSRegularExpression. I don't want the number of matches or to replace the string, I want the string that matches the Regular Expression NSString *string = www.apple.com NSError…
0
votes
1 answer

How do I remove all page formatting from NSString

I have an NSMutableString* (theBigString) that contains text loaded from an online file. I am writing theBigString to a local file on the iPad and then emailing it as an attachment. [theBigString appendString:[[NSString alloc] initWithData:data…
Scooter
  • 4,068
  • 4
  • 32
  • 47
0
votes
1 answer

Cannot pass special characters to an NSTask

In Cocoa, I would like to pass a string containing special characters to an NSTask as arguments, however the task does not get the proper string. NSString *city=@"Zürich"; // This is the string with a special character [arguments addObject:[NSString…
1 2 3
8 9