- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

Character in 'c' format wrapped in pack

(W pack) You said

pack("c", $x)

where $x is either less than -128 or more than 127; the "c" format is only for encoding native operating system characters (ASCII, EBCDIC, and so on) and not for Unicode characters, so Perl behaved as if you meant

pack("c", $x & 255);

If you actually want to pack Unicode codepoints, use the "U" format instead.

ISBN 9781906966027Perl Language Reference ManualSee the print edition