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

[PATCH] readable error messages on non-ASCII systems

From: Greg Ames <ames.greg_at_gmail.com>
Date: Tue, 11 May 2010 19:36:48 -0400

I am attempting to get the subversion client running on z/OS. I am starting
with svn 1.5.6 because I don't want to port SQLite first, at least not until
I have a working "svn co". autogen.sh, configure, and make run to
completion after some build hacks. Then make install dies with:

subversion/svnversion/svnversion . /repos/svn/trunk >
/u/USER193/svn/cvs-1.5.6/subversion-1.5.6/built/include/subversion-1/svn-revision.txt
?\162?\165?\149: ?\229?\129?\147?\137?\132 ?\228?\227?\198-?\248
?\132?\129?\163
?\129
(?\136?\133?\167: ?\242?\133 ?\246?\241 ?\244?\130)
?\134?\150?\147?\147?\150?\166?\133?\132 ?\130?\168
?\137?\149?\165?\129?\147?\1
37?\132 ?\228?\227?\198-?\248 ?\162?\133?\152?\164?\133?\149?\131?\133
(?\136?\133?\167: ?\129?\242 ?\129?\245 ?\249?\245 ?\246?\241)
FSUM8226 make: Error code 8

With the following patch, the situation improves and I can read the error
messages without looking at EBCDIC code point charts.

subversion/svnversion/svnversion . /repos/svn/trunk >
/u/USER193/svn/cvs-1.5.6/subversion-1.5.6/built/include/subversion-1/svn-revision.txt
svn: Valid UTF-8 data
(hex: 2e 61 4b)
followed by invalid UTF-8 sequence
(hex: a2 a5 95 61)
FSUM8226 make: Error code 8

The error messages are in the native code page to start with, so running
them through a UTF-8 -> native conversion doesn't do anything helpful.

I have a handful of other patches that get subversion 1.5.6 to where
svnversion and "svn help [subcommand]" work properly. I'm pretty confident
that I can take it beyond that, but I want to start posting patches one baby
step at a time.

Regards,
Greg

Index: subversion/libsvn_subr/cmdline.c
===================================================================
--- subversion/libsvn_subr/cmdline.c (revision 943316)
+++ subversion/libsvn_subr/cmdline.c (working copy)
@@ -318,24 +318,15 @@
 svn_error_t *
 svn_cmdline_fputs(const char *string, FILE* stream, apr_pool_t *pool)
 {
- svn_error_t *err;
- const char *out;
+ /* "string" is native. do not try to convert from UTF-8 */

- err = svn_cmdline_cstring_from_utf8(&out, string, pool);
-
- if (err)
- {
- svn_error_clear(err);
- out = svn_cmdline_cstring_from_utf8_fuzzy(string, pool);
- }
-
   /* On POSIX systems, errno will be set on an error in fputs, but this
might
      not be the case on other platforms. We reset errno and only
      use it if it was set by the below fputs call. Else, we just return
      a generic error. */
   errno = 0;

- if (fputs(out, stream) == EOF)
+ if (fputs(string, stream) == EOF)
     {
       if (errno)
         return svn_error_wrap_apr(errno, _("Write error"));
Received on 2010-05-12 01:37:17 CEST

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

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