<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=utf-8">
<META content="MSHTML 5.50.4807.2300" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>There is also more info on Unicode Strings and Octets 
here:</FONT></DIV>
<DIV><FONT size=2><A 
href="http://modernperlbooks.com/books/modern_perl_2016/03-perl-language.html#VW5pY29kZWFuZFN0cmluZ3M">http://modernperlbooks.com/books/modern_perl_2016/03-perl-language.html#VW5pY29kZWFuZFN0cmluZ3M</A></FONT></DIV>
<DIV><FONT size=2></FONT>&nbsp;</DIV>
<BLOCKQUOTE 
style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
  <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
  <DIV 
  style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
  <A title=catalystgroup@unitedgames.co.uk 
  href="mailto:catalystgroup@unitedgames.co.uk">Andrew</A> </DIV>
  <DIV style="FONT: 10pt arial"><B>To:</B> <A title=catalyst@lists.scsys.co.uk 
  href="mailto:catalyst@lists.scsys.co.uk">The elegant MVC web framework</A> 
  </DIV>
  <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, February 11, 2020 12:37 
  AM</DIV>
  <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: [Catalyst] Encoding</DIV>
  <DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>So what's happening in the controller, that might change 
  it?</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Are you using commands or modules that work only with octets 
  instead of UTF-8?</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>my $octets = encode("UTF-8", $utf8_string);</FONT></DIV>
  <DIV><FONT size=2>...converts UTF-8 to Octets.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>my $utf8_string = decode("UTF-8", $octets);</FONT></DIV>
  <DIV><FONT size=2>...converts Octets to UTF-8.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>I put...</FONT></DIV>
  <DIV><FONT size=2>use Encode qw(decode encode);</FONT></DIV>
  <DIV><FONT size=2>...at the start of my controller to use these 
  functions.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>My UTF-8 boiler plate for my Catalyst Controllers 
  is:</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT 
  size=2>#Always:<BR>use&nbsp;&nbsp;strict;<BR>use&nbsp;&nbsp;warnings;<BR>use&nbsp;&nbsp;Moose;<BR>use&nbsp;&nbsp;namespace::autoclean;</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT 
  size=2>#UTF-8:<BR>use&nbsp;&nbsp;utf8;<BR>use&nbsp;&nbsp;v5.30;<BR>use&nbsp;&nbsp;warnings 
  (<BR>&nbsp;&nbsp;&nbsp;'FATAL',&nbsp;#makes anything in this list 
  fatal<BR>&nbsp;&nbsp;&nbsp;'utf8',&nbsp;&nbsp;#utf8 is a warnings 
  category.&nbsp;<BR>&nbsp;&nbsp;);<BR></FONT></DIV>
  <DIV><FONT size=2>#Specific:&nbsp;<BR>use&nbsp;&nbsp;Encode 
  <BR>&nbsp;&nbsp;&nbsp;qw(<BR>&nbsp;&nbsp;&nbsp;&nbsp;decode 
  <BR>&nbsp;&nbsp;&nbsp;&nbsp;encode<BR>&nbsp;&nbsp;&nbsp;);<BR></FONT></DIV>
  <DIV><FONT size=2>...and any other specific modules I need, I put in the 
  specific bit.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>The reason I use...</FONT></DIV>
  <DIV><FONT size=2>use v5.30;</FONT></DIV>
  <DIV><FONT size=2>...is because it enables for following 
features:</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>unicode_strings (auto-enabled with "use v5.12;" or 
  higher),</FONT></DIV>
  <DIV><FONT size=2>unicode_eval (auto-enabled with "use v5.16;" or 
  higher),</FONT></DIV>
  <DIV><FONT size=2>fc (auto-enabled with "use v5.16;" or higher).</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>I guess I could just use v5.16,&nbsp;haha.</FONT></DIV>
  <DIV><FONT size=2>I use v5.30&nbsp;because it's fun to be working with the 
  latest Perl, =).</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>There are two webpages I found useful for understanding Perl 
  and Unicode:</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><A 
  href="https://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default/6163129#6163129">https://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default/6163129#6163129</A></FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2><A 
  href="https://www.perl.com/pub/2012/04/perlunicook-standard-preamble.html/">https://www.perl.com/pub/2012/04/perlunicook-standard-preamble.html/</A></FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>However, I do not know if it is a Perl and Unicode 
  issue.</FONT></DIV>
  <DIV><FONT size=2>It could be a MySQL issue,</FONT></DIV>
  <DIV><FONT size=2>it could be a really simple mistake somewhere in the code, 
  etc,</FONT></DIV>
  <DIV><FONT size=2>it could be the other module you're using, etc.</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2>Until you share more context,</FONT></DIV>
  <DIV><FONT size=2>it's difficult to know what the problem could 
  be.</FONT></DIV>
  <DIV><FONT size=2>Even then, I'm not an expert at character codes, 
  ^_^.</FONT></DIV>
  <DIV><FONT size=2>I do hope someone in this list can help you 
  though,</FONT></DIV>
  <DIV><FONT size=2>and everything works out, =).</FONT></DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <DIV><FONT size=2></FONT>&nbsp;</DIV>
  <BLOCKQUOTE 
  style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
    <DIV style="FONT: 10pt arial">----- Original Message ----- </DIV>
    <DIV 
    style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> 
    <A title=thg.bot@gmail.com href="mailto:thg.bot@gmail.com">Theo Bot</A> 
    </DIV>
    <DIV style="FONT: 10pt arial"><B>To:</B> <A title=catalyst@lists.scsys.co.uk 
    href="mailto:catalyst@lists.scsys.co.uk">The elegant MVC web framework</A> 
    </DIV>
    <DIV style="FONT: 10pt arial"><B>Sent:</B> Monday, February 10, 2020 1:22 
    PM</DIV>
    <DIV style="FONT: 10pt arial"><B>Subject:</B> [Catalyst] Encoding</DIV>
    <DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
    <DIV dir=ltr>
    <DIV>Hi,</DIV>
    <DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
    <DIV>I created a controller that requests data from a mysql database via 
    another module. The data in this case is a place in Germany called "<SPAN 
    lang=EN-US>Münster". In the module that requests the data from mysql, with 
    the mysql_enable_utf8 flag set to 1,&nbsp; it is still correct just before 
    it is returned to the catalyst controller. But what it arrives in the 
    controller someting has changed. The original character values 
    are:</SPAN></DIV>
    <DIV>77 - 252 - 110 - 115 - 116&nbsp; - 101 - 114<BR></DIV>
    <DIV><FONT size=2></FONT><FONT size=2></FONT><BR></DIV>
    <DIV>But when they arrive in the controller it has changed into<BR></DIV>
    <DIV><BR></DIV>
    <DIV>77 - 195 - 188 - 110 - 115 - 116 - 101 - 114<BR><SPAN 
    lang=EN-US><SPAN></SPAN></SPAN></DIV>
    <DIV><BR></DIV>
    <DIV>And becomes unreadable. How do I handle this?<BR></DIV>
    <DIV>-- <BR>
    <DIV class=gmail_signature dir=ltr data-smartmail="gmail_signature">
    <DIV dir=ltr>
    <DIV><BR></DIV>
    <DIV>Kind regards</DIV>
    <DIV><BR></DIV>
    <DIV>Theo<BR></DIV>
    <DIV><BR></DIV>
    <DIV><BR></DIV></DIV></DIV></DIV></DIV>
    <P>
    <HR>

    <P></P>_______________________________________________<BR>List: 
    Catalyst@lists.scsys.co.uk<BR>Listinfo: 
    http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<BR>Searchable 
    archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<BR>Dev 
    site: http://dev.catalyst.perl.org/<BR></BLOCKQUOTE>
  <P>
  <HR>

  <P></P>_______________________________________________<BR>List: 
  Catalyst@lists.scsys.co.uk<BR>Listinfo: 
  http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst<BR>Searchable 
  archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/<BR>Dev site: 
  http://dev.catalyst.perl.org/<BR></BLOCKQUOTE></BODY></HTML>