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 encode the Numeric code in iPhone

I am having some numerical code and i want to encode the "Numerical Code". So how can i encode the string?. I have tried with NSASCIIStringEncoding and NSUTF8StringEncoding, but it doesn't encoded the string. So please help me out. Eg : İ…
Pugalmuni
  • 9,350
  • 8
  • 56
  • 97
0
votes
1 answer

Converting NSData to NSString without encoding

I am trying to upload a image onto server's database. For that I have done Converted image to nsdata using UIImageJPEGReprenstation. Converted nsdata to nstring using base64lib. Problem here is that nsstring that I have is NSASCII encoded. So the…
Amol Ghotankar
  • 2,008
  • 5
  • 28
  • 42
0
votes
0 answers

We are facing problem while creating compressed file of transferred socket data in hex string to converting to .tgz file in iOS App

We are facing problem while creating compressed file at iOS Device Document Directory, .tgz file is in Hex string transferring from pin-pad device to iPad iOS App at TCP socket layer. We used below HexToString function to convert that hex string and…
0
votes
1 answer

Converting a photo data to nsstring returns nil

I'm allowing the users of my app to either take a pic or select one from their library. When selected I need to get the images' data and convert it to a string so I can send it to a web service. The problem I'm currently having is that [NSString…
bennythemink
  • 5,096
  • 4
  • 36
  • 54
0
votes
1 answer

A single "|" character in the URL breaks loading contents of URL

I'm trying to load an article in JSON format from the Wikipedia API and I get these errors: nil host used in call to allowsSpecificHTTPSCertificateForHost nil host used in call to allowsAnyHTTPSCertificateForHost: NSURLConnection finished with error…
Vulkan
  • 1,004
  • 16
  • 44
0
votes
1 answer

NSString initWithBytesNoCopy returns nil while using NSUTF32StringEncoding encoding

I am developing a bridge between C++ and Swift. So I need to convert C++ u32 string into swift String. Here is the problematic code: int count = linesProvider->getDisplayLinesCount(); NSMutableArray *lines = [[NSMutableArray alloc]…
Semyon Tikhonenko
  • 3,872
  • 6
  • 36
  • 61
0
votes
1 answer

Creating URL from String(with encoding)

I am trying to create URL from String like the following let searchParam = "?name=movies&Genre=#Action" func searchMovies(searchString: String) { let encodedString = searchParam.encodeSearchString() let urlString =…
user2431170
  • 151
  • 2
  • 11
0
votes
1 answer

How to format string encoded with NSASCIIStringEncoding

In my Objective-C project, I'm fetching a key from cloudKit and wanted to format it before like this and wondering what's wrong with the formatting, [cloudKitDB performQuery:query inZoneWithID:nil completionHandler:^(NSArray *…
webmastx
  • 683
  • 1
  • 8
  • 30
0
votes
1 answer

In my macOS application, I am working with UserDefaults dictionaryRepresentation. Sometimes I get strings with unknown encoding. Any suggesition?

I am working with a Objective-C Application, specifically I am gathering the dictionary representation of NSUserDefaults with this code: NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSDictionary *userDefaultsDict = [defaults…
Alfonso Tesauro
  • 1,730
  • 13
  • 21
0
votes
1 answer

Why do I get different UTF-8 representations of an NSString depending on string construction or when running in different environments?

I have some very simple Objective-C code that allocates and initialises an NSString and then gets the UTF-8 const char * representation of that string as follows: const char *s = [[[NSString alloc] initWithFormat:@"%s", "£"] UTF8String]; I then…
hamchapman
  • 2,901
  • 4
  • 22
  • 37
0
votes
1 answer

How to decode windowsCP1252 encoded string Swift

From a web service my application receiving a JSON response. In which one field is a windowsCP1252 encoded string. I am trying to decode it with following code, let input = "സൗപർണിക"//a string from server response let data =…
Johnykutty
  • 12,091
  • 13
  • 59
  • 100
0
votes
0 answers

Objective C two equal strings are not evaluating to equal even when the bytes are the same

I have a product string: NSString* product = models[[[peripheral identifier] UUIDString]]; and in the debugger I can print: po product >>> X3 and I can check the bytes: po [product dataUsingEncoding:NSUTF8StringEncoding] >>> <5833> I can also…
Chase Roberts
  • 9,082
  • 13
  • 73
  • 131
0
votes
1 answer

Removing non-ascii characters from NSData?

First off, I'm not exactly sure what is happening or if I fully understand it enough to describe the issue so I'll try my best. I'm encoding a NSData object that contains json and one of the objects contains a degree symbol. We believe this what is…
Seth Kurkowski
  • 223
  • 2
  • 11
0
votes
0 answers

Swift: Converting from _PFEncodedString to String (export of Core Data attributes using JSONEncoder)

I’m coding Swift for iOS 11, and in some context (described in part 2) I end up with a variable of type String. However, when examining the variable in Xcode’s debugger the type is shown as _PFEncodedString (which I have read elsewhere is an…
rene
  • 1,975
  • 21
  • 33
0
votes
0 answers

Is emoji encode UTF16 contain space

This code determines if a String contains whitespace and newline: - (BOOL)isNoBlack { NSCharacterSet* charSet = [NSCharacterSet whitespaceAndNewlineCharacterSet]; for (int i = 0; i < self.length ; i++) { unichar ch = [self…
Shadow
  • 45
  • 4
1 2 3
8 9