Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^5: passing data structures from java to perl

by exussum0 (Vicar)
on Jul 28, 2010 at 23:25 UTC ( #851823=note: print w/replies, xml ) Need Help??


in reply to Re^4: passing data structures from java to perl
in thread passing data structures from java to perl

That's really really bad advice. You can get encoding errors like that on the java side. Yeah, the bytes in memory are all that matter and you're fine to interpret, but on the way in and out, you're playing with things.

It's the same thing like binmode. You're affecting the data as the IO occurs to get into our out of memory. See...

http://www.docjar.com/docs/api/java/nio/charset/UnmappableCharacterException.html

I've run into this exact problem using the XML feeds for perlmonks while working in java.

  • Comment on Re^5: passing data structures from java to perl

Replies are listed 'Best First'.
Re^6: passing data structures from java to perl
by almut (Canon) on Jul 28, 2010 at 23:37 UTC

    Not sure what you're talking about.  UTF-8 is a variable-width (multi-byte-if-needed) encoding that can encode the full unicode character set, so why should there be encoding errors, or an UnmappableCharacterException?  An UnmappableCharacterException is thrown if a certain character can't be represented in the specified target encoding, but as all unicode characters can be encoded in UTF-8, this exception cannot occur.

    UnmappableCharacterExceptions may happen if you try to encode unicode data to Latin-1, for example, but not with UTF-8.

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^6: passing data structures from java to perl
by Anonymous Monk on Jul 29, 2010 at 03:38 UTC
    That's really really bad advice. You can get encoding errors like that on the java side.

    How do you figure, please explain?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://851823]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2020-09-27 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (142 votes). Check out past polls.

    Notices?