--- sJab.bak Wed Oct 6 07:34:49 2004
+++ sJab Mon Oct 18 04:25:56 2004
@@ -49,6 +49,7 @@
#####################################################################
use Net::Jabber qw(Client);
use Getopt::Std;
+use Unicode::String qw(latin1 utf8);
#use strict;
getopt('upcstmq',\%opts); # Get options
@@ -89,7 +90,7 @@
# Jabber-Specific "Constants"
#my $SUBJECT = "Aviso sJab";
-my $SUBJECT = $opts{q};
+my $SUBJECT = &utf8($opts{q});
#my $SERVER = "jabberes.org";
my $SERVER = "amessage.info";
my $PORT = 5222; # Jabber Port
@@ -116,10 +117,10 @@
# If a Message is defined, don't use STDIN
if ($opts{t} && $opts{m}) {
- jabberMessage($user, $SUBJECT, $msg);
+ jabberMessage($user, $SUBJECT, &utf8($msg));
}
elsif ($opts{c} && $opts{s} && $opts{m}) {
- jabberGroup($conference,$server,$msg);
+ jabberGroup($conference,$server,&utf8($msg));
}
else {
# Take input from STDIN
@@ -140,7 +141,7 @@
exit(0);
}
}
- jabberMessage($user, $SUBJECT, $msg) if ($opts{t});
+ jabberMessage($user, $SUBJECT, &utf8($msg)) if ($opts{t});
}
# Disconnect from Jabber Service
@@ -267,4 +268,7 @@
}
-
+sub utf8 {
+ my $c=latin1(shift);
+ return $c->utf8;
+}