agostonbejo wrote: > > Hi! > > What I'm trying to do is to insert some data from a sql file into a postgres > DB by calling the <sql> ant task. My problem is that I can't get special > characters (even if they can be represented by the standard ASCII charset, > such as ä, ö, ü, é, etc.) to be inserted correctly. Those aren't ASCII. > When I check the DB with a DB browser such as Squirrel or pgAdmin, after > running the <sql> task they can only see question marks where these > characters are supposed to be. So does the actual web application using the > DB. (The web app can store and read such special characters seamlessly, > though. It's also OK if I enter some of them by hand with the DB browsers > mentioned above.) [snip] > Does anyone have any idea how to get those special characters loaded into > the DB from a pre-written sql file (possibly with the ant <sql> task)? There are three places you need to get this right: 1. The database encoding 2. The client encoding 3. The encoding of the contents of the .sql file Now, since the database is UTF8 that means it can accept the entire range of unicode characters, including all ISO-8859-1. PostgreSQL can automatically convert from ISO-8859-1 to UTF-8 for you, so it doesn't matter which you have in your .sql file. What *does* matter is that you know what encoding your .sql file is using and that you set the client encoding appropriately. Since you're using Java, it's probably simplest just to use UTF-8 all the way through. Crucially, make sure you know what the character-set of the .sql file is - any good text editor should be able to tell you / set this. -- Richard Huxton Archonet Ltd -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general