Convert text from UTF8 to ASCII - Mailing list pgsql-sql
From | Paul Dam |
---|---|
Subject | Convert text from UTF8 to ASCII |
Date | |
Msg-id | 28DD271C986F234A9B4573938292C1B31BD704@s0008.a-more.org Whole thread Raw |
Responses |
Re: Convert text from UTF8 to ASCII
Re: Convert text from UTF8 to ASCII |
List | pgsql-sql |
<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>