Wide character in subroutine entry - how to get bytes for md5_hex?

A

A. Farber

Hello,

I develop a card game in Flash+Perl and use phpBB as backend.
Besides using phpBB for user auth. I also want to log played
games as posts in one of the forums (in utf8 encoding). So I try:

use constant SPADES_HTML => pack ' U', 0x2660;
use constant DIAMONDS_HTML => pack ' U', 0x2666;
use constant CLUBS_HTML => pack ' U', 0x2663;
use constant HEARTS_HTML => pack ' U', 0x2665;

And then:

my $body = 'BODY TEST 10' . HEARTS_HTML;
$Sth_create_post->execute('HEADER TEST 7' . SPADES_HTML,
$body, md5_hex($body), '12345678') or die $Dbh->errstr;

(because phpBB wants to have md5-checksum as well)

Unfortunately md5 fails with "Wide character in subroutine entry".
It probably notices that the input is in UTF8 and not in bytes?
Is there a way to pass the actual bytes to the md5_hex call?

Thank you
Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top