Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WEhC8-0005Lm-4B for pgsql-sql@arkaria.postgresql.org; Sat, 15 Feb 2014 15:30:20 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WEhC7-0004GF-Db for pgsql-sql@arkaria.postgresql.org; Sat, 15 Feb 2014 15:30:19 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WEhC6-0004Ft-90; Sat, 15 Feb 2014 15:30:18 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WEhC3-0001yB-3U; Sat, 15 Feb 2014 15:30:17 +0000 Received: by mail-pa0-f43.google.com with SMTP id rd3so13510696pab.2 for ; Sat, 15 Feb 2014 07:30:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to:content-type:content-transfer-encoding; bh=W5SPpDF++tBuweCf03lekSzkVrGj1Fit5m8C7T7dObw=; b=DrZGa+F1RuEIG4xxXjWQnHo1a8GI18ZqN+NOxRhE10wEnGPvCbhW4gj39B54bcqtfM Ow4s3+fga9StBBvOrSFPuqbgi8iLi/EoJTr0F03yhtBIlkOLrsaDiugtG++ak3Idjlbe 7+S6WY8EzKwa8kWyDpSHacdstCiGTk8JPzXIOob1t3VIdBqti/djslT+9JjXma3YTzGg qjUHf06qlFJUV+DykUO1bc1uYwUzDqS+TeLPHtUhpi7kBSbOFfqUudRhtU9cvjJJ/tUt uh6Mu1y/NhcxlOXFDW7ojhctZmcZl30TVJDf+8rHqawRmllQKPvky/+9NSDpsafPpMdJ Brmw== X-Received: by 10.68.92.98 with SMTP id cl2mr15835600pbb.81.1392478213196; Sat, 15 Feb 2014 07:30:13 -0800 (PST) Received: from panda.site (65-102-185-39.tukw.qwest.net. [65.102.185.39]) by mx.google.com with ESMTPSA id si6sm69437039pab.19.2014.02.15.07.30.12 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 15 Feb 2014 07:30:12 -0800 (PST) Message-ID: <52FF8801.30005@gmail.com> Date: Sat, 15 Feb 2014 07:30:09 -0800 From: Adrian Klaver User-Agent: Mozilla/5.0 (X11; Linux i686; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 MIME-Version: 1.0 To: avpro avpro , "pgsql-novice@postgresql.org" , pgsql-sql@postgresql.org Subject: Re: References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -0.1 (/) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-sql Precedence: bulk Sender: pgsql-sql-owner@postgresql.org On 02/15/2014 03:18 AM, avpro avpro wrote: > > Hello all, > > In postgresql 9.3 using pgAdmin, I created a table for my application > developed in Qt Creator. > the table contains: > idstudent - pk > name > country > town > street > > > I would like to import a csv file containing all the info about these > students. The file was saved/encoded in excel with UTF8 characters. You specified UTF8 when creating the CSV file? > > When I'm importing my file in psql, using the encoding UTF8, I receive > the following error for each character not recognized: > "error: invalid byte sequence for encoding "UTF8": ... " followed by the > character code > > I tried to import the file using SQL_ASCII, I got similar errors. > I tried to import the file using MULE_INTERNAL and it worked, but the > characters not recognized are not shown correct in pdAdmin and in my > application when query is executed. For example after I imported the > file with LATIN1 all unrecognized characters were replaced with "?". > > Any suggestion what encoding shall I use to display the characters > correctly? Might want to take a look at this tool: https://pypi.python.org/pypi/chardet > > note: the student's names and addresses are written using characters > from North Europe, Eastern EU, Russia, South America, Asia, etc. > everywhere. > > Thank you for your input. -- Adrian Klaver adrian.klaver@gmail.com -- Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-sql