Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Thank you for the helpful responses. I learned several new things. However, I am still unable to get my program functioning correctly.

For starters, I am not opening a file. I am receiving the utf8 input from an HTML form, and, quite frankly, I have no way of knowing whether user input will be received in the Perl script as utf8, unicode, big5, gb2312, etc., although I am trying to work solely with utf8. The database being searched is in utf8, but Perl is doing next to nothing with it once received with the DBI commands, other than outputting it back to HTML.

On your advice, I tried learning more about utf8, and have tried using the -COE command in the shebang line (this rendered the output unreadable), and I tried using the Encode qw(encode decode), to no avail.

Here are my current uses:

use CGI; use CGI::Carp qw(fatalsToBrowser); use strict; use DBI; use Encode; use Encode qw(_utf8_on); use Encode::HanConvert; #Module for dealing with CJK conversions use Encode qw(encode decode); require Encode::CN; require Encode::TW;
So I am still left wondering how to make perl see the string as utf8. Am I missing something? Is Perl 5.8.7 recent enough? How can I flag utf8 on input from a form rather than a file?

The real puzzle, to me, is that split// seems to work, but the s/// won't work. Unfortunately, I have no way of knowing how many terms the user will be entering, so using split would require some significant recoding. Thank you!


In reply to Re^2: Unicode substitution regex conundrum by Polyglot
in thread Unicode substitution regex conundrum by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others surveying the Monastery: (14)
    As of 2014-07-23 20:20 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      My favorite superfluous repetitious redundant duplicative phrase is:









      Results (152 votes), past polls