Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
A few observations regarding your utf-8 issues:

  • The reason the is_utf8() check failed is because of Perl's backward compatability issues. For hex values of "\x{00FF}" or less, the is_utf8() check is supposed to fail. Here are are a few examples using your variables:
  • binmode \*STDOUT, ':utf8'; my $u_temp = "Temperature:350\x{00B0}F html:°"; my $smiley = "Smiley:\x{263a}"; my $price_label = "Price:\x{20AC}9.99"; print 'is degree' if utf8::is_utf8( $u_temp ); print 'is smiley' if utf8::is_utf8( $smiley ); print 'is price label' if utf8::is_utf8( $price_label );
  • Others have already posted about binmode(), or 'use open' layers.
  • In addition to Perl related issues, also ensure that your fonts for X (or Linux console), as well as your browser (or xterm, or cat(1) ) are also able to display in utf8 charrs using utf-8 fonts. (I use LatCyrGr-16.psf fonts for Linux console.)

    In reply to Re: UTF-8 from a CGI script by ioannis
    in thread UTF-8 from a CGI script by PerlRudi

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



    • Are you posting in the right place? Check out Where do I post X? to know for sure.
    • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
      <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
    • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
    • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (1)
As of 2024-04-25 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found