Обсуждение: Convert text from UTF8 to ASCII

Поиск
Список
Период
Сортировка

Convert text from UTF8 to ASCII

От
"Paul Dam"
Дата:
<div class="Section1"><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Hoi,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">I store content of an .txt file in a text column in the database.</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial">server_encoding is UTF8.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">If the .txt file is in ASCII this is correctly stored in the database.</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial">If the .txt file is in UTF8 this is NOT correctly stored in the database.</span></font><p
class="MsoNormal"><fontface="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">Examples:</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial">In Dutch the term for patient is 'patiënt'.</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanstyle="font-size:10.0pt; 
font-family:Arial">It is stored as 'patiënt'.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">The first line of the .txt file is 'AAAAAAAAAAAA'.</span></font><p class="MsoNormal"><font
face="Arial"size="2"><span style="font-size:10.0pt; 
font-family:Arial">It is stored as '</span></font><font color="black" face="MS Shell Dlg 2" size="1"><span
style="font-size:8.5pt;font-family:"MSShell Dlg 2"; 
color:black"></span></font><font face="Arial" size="2"><span style="font-size:
10.0pt;font-family:Arial">AAAAAAAAAAAA'.</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
style="font-size:10.0pt;
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt;
font-family:Arial">How can I convert patiënt into patiënt?</span></font><p class="MsoNormal"><font face="Arial"
size="2"><spanstyle="font-size:10.0pt; 
font-family:Arial">Or more precise: How can I convert the text column to the correct format, before insert or when
selecting?</span></font><pclass="MsoNormal"><font face="Arial" size="2"><span style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="NL"
style="font-size:10.0pt;
font-family:Arial">Met vriendelijke groet,</span></font><p class="MsoNormal"><font face="Arial" size="2"><span
lang="NL"style="font-size:10.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="NL"
style="font-size:10.0pt;
font-family:Arial">Paul Dam</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="NL"
style="font-size:10.0pt;
font-family:Arial">Informatieanalist</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="NL"
style="font-size:10.0pt;
font-family:Arial"> </span></font><font face="Arial"><span lang="NL" style="font-family:Arial"></span></font><p
class="MsoNormal"><fontface="Arial" size="3"><span lang="NL" style="font-size:12.0pt; 
font-family:Arial"> </span></font><p class="MsoNormal"><font face="Times New Roman" size="3"><span lang="NL"
style="font-size:12.0pt"> <imgheight="52" id="_x0000_i1025" src="cid:image001.gif@01C9A263.16FCAD50" width="150"
/></span></font><pclass="MsoNormal"><font face="Times New Roman" size="3"><span lang="NL" style="font-size:12.0pt"><br
/><strong><b><fontface="Times New Roman">Amyyon</font></b></strong><b><span style="font-weight:bold"><br
/></span></b>Bijsterhuizen11.58</span></font><p class="MsoNormal"><font face="Times New Roman" size="3"><span lang="NL"
style="font-size:12.0pt">6546AS Nijmegen</span></font><p class="MsoNormal"><font face="Arial" size="2"><span lang="NL"
style="font-size:10.0pt;
font-family:Arial">050 - 311 5686</span></font><span lang="NL"></span><p class="MsoNormal"><font face="Arial"
size="2"><spanlang="NL" style="font-size:10.0pt; 
font-family:Arial"><a href="http://www.amyyon.nl/" title="http://www.amyyon.nl">www.amyyon.nl</a></span></font><span
lang="NL"></span><pclass="MsoNormal"><font face="Times New Roman" size="3"><span lang="NL"
style="font-size:12.0pt"> </span></font></div>

Re: Convert text from UTF8 to ASCII

От
Claus Guttesen
Дата:
> I store content of an .txt file in a text column in the database.
>
> server_encoding is UTF8.

What does 'psql -l' say?

-- 
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare


Re: Convert text from UTF8 to ASCII

От
"Leif B. Kristensen"
Дата:
On Wednesday 11. March 2009, Paul Dam wrote:
>Hoi,
>
>
>
>I store content of an .txt file in a text column in the database.
>
>server_encoding is UTF8.
>
>
>
>If the .txt file is in ASCII this is correctly stored in the database.
>
>If the .txt file is in UTF8 this is NOT correctly stored in the
> database.
>
>
>
>Examples:
>
>In Dutch the term for patient is 'patiënt'.
>
>It is stored as 'patiënt'.

That looks a lot like UTF-8 to me. What is your client-encoding?

--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/


Re: Convert text from UTF8 to ASCII

От
"Paul Dam"
Дата:
UNICODE.

Met vriendelijke groet,
Paul Dam
Informatieanalist


Amyyon
Bijsterhuizen 11.58
6546 AS Nijmegen
050 - 311 5686
www.amyyon.nl

-----Oorspronkelijk bericht-----
Van: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] Namens Leif B. Kristensen
Verzonden: woensdag 11 maart 2009 16:46
Aan: pgsql-sql@postgresql.org
CC: Paul Dam
Onderwerp: Re: [SQL] Convert text from UTF8 to ASCII

On Wednesday 11. March 2009, Paul Dam wrote:
>Hoi,
>
>
>
>I store content of an .txt file in a text column in the database.
>
>server_encoding is UTF8.
>
>
>
>If the .txt file is in ASCII this is correctly stored in the database.
>
>If the .txt file is in UTF8 this is NOT correctly stored in the
> database.
>
>
>
>Examples:
>
>In Dutch the term for patient is 'patiënt'.
>
>It is stored as 'patiënt'.

That looks a lot like UTF-8 to me. What is your client-encoding?

--
Leif Biberg Kristensen | Registered Linux User #338009
Me And My Database: http://solumslekt.org/blog/

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql






Re: Convert text from UTF8 to ASCII

От
"Paul Dam"
Дата:
UTF8

Met vriendelijke groet,
Paul Dam
Informatieanalist


Amyyon
Bijsterhuizen 11.58
6546 AS Nijmegen
050 - 311 5686
www.amyyon.nl
-----Oorspronkelijk bericht-----
Van: pgsql-sql-owner@postgresql.org
[mailto:pgsql-sql-owner@postgresql.org] Namens Claus Guttesen
Verzonden: woensdag 11 maart 2009 16:43
Aan: Paul Dam
CC: pgsql-sql@postgresql.org
Onderwerp: Re: [SQL] Convert text from UTF8 to ASCII

> I store content of an .txt file in a text column in the database.
>
> server_encoding is UTF8.

What does 'psql -l' say?

--
regards
Claus

When lenity and cruelty play for a kingdom,
the gentler gamester is the soonest winner.

Shakespeare

--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql