• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Representation of strings with special chars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Representation of strings with special chars


  • Subject: Re: Representation of strings with special chars
  • From: David Duncan <email@hidden>
  • Date: Wed, 24 Aug 2011 11:14:44 -0700

On Aug 24, 2011, at 11:07 AM, Alexander Reichstadt wrote:

> we have a phenomenon, that is not quite clear. This is with 10.6.7 Xcode 4.0.
>
>    NSArray *test = [NSArray arrayWithObject:@"ÜÄÖüäö"];
>    NSLog(@"%@",test);
>    NSLog(@"%@",[test objectAtIndex:0]);
>
> This prints out the following:
>
> 2011-08-24 20:03:19.129 PetWorkX[15717:903] (
>    "\U00dc\U00c4\U00d6\U00fc\U00e4\U00f6"
> )
> 2011-08-24 20:03:19.129 PetWorkX[15717:903] ÜÄÖüäö
>
> Reason to ask and problem to solve is, that the values with Umlauts are to be passed on to an SQL backend, and in some cases the umlauts are not forwarded correctly. Escaped they return no answer or, even worse, cause an SQL error and the sql connection to break. Also escaping the umlauts int he sql connection does not work.
>
> So far we weren't able to fully figure out under which conditions the umlauts are passed on correctly and under what conditions they aren't.


In this case since you are using a compiler literal, you are at the mercy of what the compiler generates. It would seem that you are getting composed characters in this case (your second NSLog should use %C not %@ btw). The best I can figure is that your SQL backend is expecting decomposed characters (which would represent this string as U<combining umlaut>A<combining umlaut> etc). I would try -decomposedStringWithCanonicalMapping to obtain a new string that has been decomposed and see if that works better.
--
David Duncan

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Representation of strings with special chars
      • From: Lee Ann Rucker <email@hidden>
References: 
 >Representation of strings with special chars (From: Alexander Reichstadt <email@hidden>)

  • Prev by Date: Representation of strings with special chars
  • Next by Date: Re: Representation of strings with special chars
  • Previous by thread: Representation of strings with special chars
  • Next by thread: Re: Representation of strings with special chars
  • Index(es):
    • Date
    • Thread