Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
How do get all the special characters even?

Primarily, you need a font that supports the desired character(s) (= does have a glyph for it).  And with characters outside of the Latin-1 range ('£' is not one of them), you want to use Unicode, which (according to my tests) means you can't use the core fonts any longer, but need to switch to using TrueType fonts, for example (see also Re^2: PDF::API2 / unicode characters).

Depending on where the special characters are coming from - i.e. from literal strings within the source, from files outside of the program, etc. - you need to use utf8 (when your source is UTF-8 encoded), and maybe use feature 'unicode_strings' (avoids a number of more subtle legacy issues and ambiguities with Perl's handling of Unicode (works with newer perls only)), and/or set the PerlIO encoding layer correctly for the respective file handles that the special character are read from.

As for the letter A in front of £ (I suppose you really meant Â), the problem most likely is that your source code is in UTF-8, but you did not tell Perl about it (see paragraph above) — the UTF-8 encoding of the pound sign is the two bytes \xc2 \xa3, which when incorrectly interpreted as two Latin-1 characters, renders as '£'.


In reply to Re^5: PDF::API2 Questions by Eliya
in thread PDF::API2 Questions by akwe-xavante

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 surveying the Monastery: (4)
As of 2024-04-19 04:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found