[libinline-java-perl] 361/398: ok. Now dependant on perl 5.8 and Encode.

Jonas Smedegaard dr at jones.dk
Thu Feb 26 11:43:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

js pushed a commit to tag 0.55
in repository libinline-java-perl.

commit 9d31b394c0101c8395a5a0c57ec35bdaaf642699
Author: patrick_leb <>
Date:   Sat Dec 3 02:22:29 2005 +0000

    ok. Now dependant on perl 5.8 and Encode.
---
 Java.pm          |  2 +-
 Java/Protocol.pm | 24 ++++--------------------
 2 files changed, 5 insertions(+), 21 deletions(-)

diff --git a/Java.pm b/Java.pm
index 8221ac5..48592d2 100644
--- a/Java.pm
+++ b/Java.pm
@@ -6,7 +6,7 @@ package Inline::Java ;
 
 
 use strict ;
-require 5.006 ;
+require 5.008 ;
 
 $Inline::Java::VERSION = '0.50_91' ;
 
diff --git a/Java/Protocol.pm b/Java/Protocol.pm
index 59ea80e..5dac09c 100644
--- a/Java/Protocol.pm
+++ b/Java/Protocol.pm
@@ -5,9 +5,8 @@ use Inline::Java::Object ;
 use Inline::Java::Array ;
 use Carp ;
 use MIME::Base64 ;
-BEGIN {
-	eval "require Encode" ;
-}
+use Encode () ;
+
 
 $Inline::Java::Protocol::VERSION = '0.50_91' ;
 
@@ -561,14 +560,7 @@ sub encode {
 	my $s = shift ;
 
 	# Get UTF-8 byte representation of the data.
-	my $bytes = undef ;
-	if ($INC{'Encode.pm'}){
-		$bytes = Encode::encode_utf8($s) ;
-	}
-	else {
-		$bytes = $s ;
-		$bytes =~ s/([\x80-\xFF])/chr(0xC0|ord($1)>>6).chr(0x80|ord($1)&0x3F)/eg ;
-	}
+	my $bytes = Encode::encode_utf8($s) ;
 
 	# Base-64 encode it.
 	my $base64 = encode_base64($bytes, '') ;
@@ -584,15 +576,7 @@ sub decode {
 	my $bytes = decode_base64($s) ;
 
 	# Take the UTF-8 encoding and convert it back to logical characters.
-	my $string = undef ;
-	if ($INC{'Encode.pm'}){
-		$string = Encode::decode_utf8($bytes) ;
-	}
-	else {
-		$string = $bytes ;
-		$bytes =~ s/([\xC2\xC3])([\x80-\xBF])/chr(ord($1)<<6&0xC0|ord($2)&0x3F)/eg ;
-	}
-
+	my $string = Encode::decode_utf8($bytes) ;
 	if (utf8->can('downgrade')){
 		utf8::downgrade($string, 1) ;
 	}

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libinline-java-perl.git



More information about the Pkg-perl-cvs-commits mailing list