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
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