in reply to Adding Copyright (C) symbol to an image using Image::Magick

Note that hex() expects a hexadecimal string, while 0xa9 returns a number: 169. In other words, lose the hex() call.

update: You can also do "\x{a9}" to get the character you want with the advantage that you can use it inside string literals:

print "Some program \x{a9} 2006 - Joost\n";
prints (provided your encoding is all right):
Some program © 2006 - Joost

Replies are listed 'Best First'.
Re^2: Adding Copyright (C) symbol to an image using Image::Magick
by leighsharpe (Monk) on Dec 04, 2006 at 11:02 UTC
    Looks like it well may be encoding, unless my fonts are all shagged.
    I have printed $text to the command line and it comes out as the © symbol.
    The text on the image has a square, indicating that the font doesn't recognise the symbol. I can't download Encode to this box, as it's running an old version of perl (5.6.1), and Encode needs a later version. I tried on my Fedora Core 2 box, which has an updated perl, but it won't install Image::Magick, so I'm still none the wiser.
    For the purposes of now, I think I'll just create a jpeg of the © text I need and overlay it as a watermark.
    Thanks for your input.