in reply to Re: Unicode substitution regex conundrum
in thread Unicode substitution regex conundrum
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:
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?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;
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!
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Unicode substitution regex conundrum
by moritz (Cardinal) on Oct 16, 2007 at 14:11 UTC | |
by Juerd (Abbot) on Oct 16, 2007 at 19:11 UTC | |
by moritz (Cardinal) on Oct 16, 2007 at 19:21 UTC | |
by Juerd (Abbot) on Oct 16, 2007 at 21:29 UTC | |
by Juerd (Abbot) on Oct 16, 2007 at 21:35 UTC | |
by Polyglot (Chaplain) on Oct 17, 2007 at 03:35 UTC | |
by Lu. (Hermit) on Dec 16, 2007 at 22:39 UTC |