Hi, I'm currently being forced to use perl (5.00503) on a FreeBSD machine with only the default modules installed. They admins are also not willing to install any modules.
The problem is that I have to use a CGI script to accept and process chinese characters.
$chinese_character_num = "12551";
$chinese_character = chr($chinese_character_num);
print $chinese_character;
This returns a weird block-like character( ) which I assume means it doesn't know which character to give it. I have assume (again, I'm sorry) that the problem is the machine isn't using the unicode set, and isn't loading utf8 on demand.
So, I then took the utf8 module and its required companion (utf8_heavy.pl) and threw them into the directory, and included them as follows:
use utf8 qw(-l ./);
Suprisingly, this ran without any errors, but when it tried the same code as before, I got the same result.
I have tried this whole mess on my own server, with perl 5.6.1, and it works just like its designed to. Does anyone know what I can do to make it work on the FreeBSD server?
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.