[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

svnlook Output Encoding

From: David E. Wheeler <david_at_kineticode.com>
Date: Wed, 20 Feb 2008 12:09:41 -0800

Howdy,

I'm trying to figure out why svnlook sometimes seems to output UTF-8
and sometimes does not, depending on the subcommand. Here's what I get
for `info`:

% svnlook info /usr/local/svnroot -r3448
theory
2008-02-20 09:49:20 -0800 (Wed, 20 Feb 2008)
139
I think I can ?\194?\171eliminate?\194?\187 the `_encode()` and
`_decode()` methods. So let's see how things work with them doing
nothing.

But here's what i get for `diff`:

% svnlook diff /usr/local/svnroot -r3448
Modified: SVN-Notify/trunk/t/smtp.t
===================================================================
--- SVN-Notify/trunk/t/smtp.t 2008-02-20 01:02:18 UTC (rev 3447)
+++ SVN-Notify/trunk/t/smtp.t 2008-02-20 17:49:20 UTC (rev 3448)
@@ -73,9 +73,12 @@
        'Check Date';

  # Check that the log message is there.
-like $smtp->{datasend},
- qr/Did this, that, and the «other»\. And then I did some more\.
Some\nit was done on a second line\./,
- 'Check for log message';
+UTF8: {
+ use utf8;
+ like $smtp->{datasend},
+ qr/Did this, that, and the «other»\. And then I did some more
\. Some\nit was done on a second line\./,
+ 'Check for log message';
+}

   
##############################################################################
  # Test authentication and Debug.

Notice how in the output of `info` (or `log`, for that matter) I get
bogus escapes around the word "eliminate", while when they properly
show up as « and » in the output of `diff`. I'm assuming that svnlook
is converting from UTF-8 to something else, but only for the log
message. How annoying. I don't have any UTF-8 locales on this box
(very old FreeBSD), but when I try `svn diff` on a newer box with the
environment variable set, it works:

% LANG=en_US.UTF-8 svn log -r3448
------------------------------------------------------------------------
r3448 | theory | 2008-02-20 09:49:20 -0800 (Wed, 20 Feb 2008) | 2 lines

I think I can «eliminate» the `_encode()` and `_decode()` methods. So
let's see how things work with them doing nothing.

I get the escapes if I set LANG=C

LANG=C svn log -r3448
------------------------------------------------------------------------
r3448 | theory | 2008-02-20 09:49:20 -0800 (Wed, 20 Feb 2008) | 2 lines

I think I can ?\194?\171eliminate?\194?\187 the `_encode()` and
`_decode()` methods. So let's see how things work with them doing
nothing.

So, my question is this: How can I get `svnlook info` to properly
output UTF-8 characters like `svnlook diff` does, without setting the `
$LANG` environment variable (since the box has no UTF-8 locales)?

Many thanks,

David
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: users-help_at_subversion.tigris.org
Received on 2008-02-20 21:10:20 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.