You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Conor MacNeill <co...@cenqua.com> on 2005/09/07 02:39:53 UTC

JavaHL blame callback and encoding

Hi,

I think there is a problem with the BlameCallback interface in the
current JavaHL implementation.

The callback method is defined as:

public void singleLine(java.util.Date changed,
                       long revision,
                       java.lang.String author,
                       java.lang.String line)

The problem is that, to create that line as a String instance, JavaHL
has assumed the encoding of the file content. In particular it uses the
JNI utility function env->NewStringUTF(txt) to create the line,
effectively assuming UTF-8 encoding.

Probably the interface should actually pass a byte[] for the line
content and let the client apply the encoding it wishes to use.

Cheers
Conor

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: JavaHL blame callback and encoding

Posted by Matt Quail <ma...@cenqua.com>.
> Probably the interface should actually pass a byte[] for the line
> content and let the client apply the encoding it wishes to use.

Since changing the signature of singleLine() will break existing  
code, it might be a good idea to create a BlameCallback2 interface  
which accepts byte[] (plus add an overloaded blame() method). In this  
way, users can explicitly decide if they want utf8-decoded strings or  
byte[].

=Matt


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org