Howdy,<br><br>We have run into many nightmares at our organization with regards to this. We also use PostgreSQL 8. Although there are other ways of solving the problem, I typically do something as follows:<br><br><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
use Encode qw( _utf8_off _utf8_on from_to );</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
fix {</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; my $s = shift;</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; return undef unless defined $s;</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
&nbsp;&nbsp;&nbsp; _utf8_off( $s );</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; from_to( $s, 'cp1250', 'utf8' );</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
<span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">&nbsp;&nbsp;&nbsp; _utf8_on( $s );</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
&nbsp;&nbsp;&nbsp; return $s;</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">}</span><br style="font-family: courier new,monospace; color: rgb(0, 153, 0);">
<br style="font-family: courier new,monospace; color: rgb(0, 153, 0);"><span style="font-family: courier new,monospace; color: rgb(0, 153, 0);">my $nice_string = fix( $ugly_string );</span><br><br>Perhaps this will help!<br>
<br>- Adam<br><br><div><span class="gmail_quote">On 10/4/06, <b class="gmail_sendername">John Napiorkowski</b> &lt;<a href="mailto:jjn1056@yahoo.com">jjn1056@yahoo.com</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Okay,<br><br>Sorry this had nothing to do with utf8, but some data<br>that was formated in CHARSET=windows-1252, that crazy<br>windows only format.<br><br>I found a modules called, &quot;Encode::ZapCP1252&quot; but that<br>
didn't seem to help me.&nbsp;&nbsp;It actually seemed to just<br>delete all the values it received without changing<br>anything.<br><br>I could run a regex to clean this out but that's<br>really ugly.<br><br>Has anyone run into that and found a more elegant
<br>solution (besides yelling at the people sending me<br>windows only data?)?<br><br>Thanks!<br><br>John Napiorkowski<br><br>--- John Napiorkowski &lt;<a href="mailto:jjn1056@yahoo.com">jjn1056@yahoo.com</a>&gt; wrote:<br>
<br>&gt; Hi,<br>&gt;<br>&gt; I'm having trouble inserting data that has some utf8<br>&gt; characters mixed in.&nbsp;&nbsp;I am using a postgres 8.1x<br>&gt; database and the database was created with utf8<br>&gt; option.<br>&gt;<br>
&gt; The error I get is:<br>&gt;<br>&gt; INSERT INTO ... execute failed: ERROR invalid byte<br>&gt; sequence for encoding &quot;UTF8&quot;.<br>&gt;<br>&gt; The value it's failing on is &quot;Bj�rn Stabell&quot;.<br>&gt;<br>
&gt; I looked at the DBIx::Class::UTF8Columns component<br>&gt; but<br>&gt; I wasn't sure how that could help me or if it could<br>&gt; help me.<br>&gt;<br>&gt; I'm running this under Catalyst and thought I was<br>&gt; doing utf8 correctly, based on the (unfortunately
<br>&gt; few)<br>&gt; examples I could find.<br>&gt;<br>&gt; I'm sure this is something simple I should do but<br>&gt; google is not being kind to my inquiries.&nbsp;&nbsp;How have<br>&gt; the rest of you been dealing with this?<br>
&gt;<br>&gt; Thanks!<br>&gt; John Napiorkowski<br>&gt;<br>&gt; __________________________________________________<br>&gt; Do You Yahoo!?<br>&gt; Tired of spam?&nbsp;&nbsp;Yahoo! Mail has the best spam<br>&gt; protection around<br>&gt; 
<a href="http://mail.yahoo.com">http://mail.yahoo.com</a><br>&gt;<br>&gt; _______________________________________________<br>&gt; List:<br>&gt;<br><a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class">http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
</a><br>&gt; Wiki: <a href="http://dbix-class.shadowcatsystems.co.uk/">http://dbix-class.shadowcatsystems.co.uk/</a><br>&gt; IRC: irc.perl.org#dbix-class<br>&gt; SVN:<br>&gt;<br><a href="http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/">
http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/</a><br>&gt; Searchable Archive:<br>&gt;<br><a href="http://www.mail-archive.com/dbix-class@lists.rawmode.org/">http://www.mail-archive.com/dbix-class@lists.rawmode.org/
</a><br>&gt;<br><br><br>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?&nbsp;&nbsp;Yahoo! Mail has the best spam protection around<br><a href="http://mail.yahoo.com">http://mail.yahoo.com</a><br>
<br>_______________________________________________<br>List: <a href="http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class">http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class</a><br>Wiki: <a href="http://dbix-class.shadowcatsystems.co.uk/">
http://dbix-class.shadowcatsystems.co.uk/</a><br>IRC: irc.perl.org#dbix-class<br>SVN: <a href="http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/">http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/</a><br>Searchable Archive: 
<a href="http://www.mail-archive.com/dbix-class@lists.rawmode.org/">http://www.mail-archive.com/dbix-class@lists.rawmode.org/</a><br></blockquote></div><br>