• 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
Storing UTF8 Umlauts in Postgres using PGSQLKit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Storing UTF8 Umlauts in Postgres using PGSQLKit


  • Subject: Storing UTF8 Umlauts in Postgres using PGSQLKit
  • From: Alexander Reichstadt <email@hidden>
  • Date: Thu, 22 Mar 2012 09:09:25 +0100

Hi,


for a couple of reasons we migrated our project from mysql to postgres using PGSQLKit.

But we are experiencing problems storing UTF8 data. So far we checked the database to be able to store UTF8. When using pgPHPAdmin to store values with German Umlaute it works. When using PGSQLKit chars get garbled.

The following code stores the values:


const char *cString = [sql cStringUsingEncoding:NSUTF8StringEncoding];
	if (cString == NULL)
	{
		self.errorDescription = [NSString stringWithFormat:@"ERROR: execCommand could not be losslessly converted to c string: %@", sql];
        [self appendSQLLog:[NSString stringWithFormat:@"%@\n", self.errorDescription]];
        return NO;
    }
	res = PQexec(pgconn, cString);

Both sides seem correct, server as well as client, so I am not sure what the issue might be.

Any ideas?

Thanks
Alex
_______________________________________________

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:
    • [Solved] Re: Storing UTF8 Umlauts in Postgres using PGSQLKit
      • From: Alexander Reichstadt <email@hidden>
  • Prev by Date: Re: Installing & running Xcode
  • Next by Date: Re: asynchronous nsurlconnection in nsoperation
  • Previous by thread: Re: NSData, CFData maximum length question
  • Next by thread: [Solved] Re: Storing UTF8 Umlauts in Postgres using PGSQLKit
  • Index(es):
    • Date
    • Thread