Ensure that libsvn_ra_dav converts the encoding of Neon error messages to
UTF-8.

* libsvn_ra_dav/ra_dav.h, libsvn_ra_dav/util.c, libsvn_ra_dav/commit.c,
  libsvn_ra_dav/fetch.c (svn_ra_dav__convert_error): Added pool argument.
  Callers updated.
  Convert error message and hostname acquired from Neon to UTF-8.

Index: subversion/libsvn_ra_dav/ra_dav.h
===================================================================
--- subversion/libsvn_ra_dav/ra_dav.h	(revision 9742)
+++ subversion/libsvn_ra_dav/ra_dav.h	(arbetskopia)
@@ -660,10 +660,11 @@
 
 /* Create an error object for an error from neon in the given session,
    where the return code from neon was RETCODE, and CONTEXT describes
-   what was being attempted. */
+   what was being attempted.  Do temporary allocations in POOL. */
 svn_error_t *svn_ra_dav__convert_error(ne_session *sess,
                                        const char *context,
-                                       int retcode);
+                                       int retcode,
+                                       apr_pool_t *pool);
 
 
 /* Given a neon REQUEST and SESSION, run the request; if CODE_P is
Index: subversion/libsvn_ra_dav/commit.c
===================================================================
--- subversion/libsvn_ra_dav/commit.c	(revision 9742)
+++ subversion/libsvn_ra_dav/commit.c	(arbetskopia)
@@ -738,7 +738,7 @@
         {
           const char *msg = apr_psprintf(dir_pool, "COPY of %s", path);
           return svn_ra_dav__convert_error(parent->cc->ras->sess,
-                                           msg, status);
+                                           msg, status, dir_pool);
         }
     }
 
@@ -928,7 +928,7 @@
         {
           const char *msg = apr_psprintf(file_pool, "COPY of %s", path);
           return svn_ra_dav__convert_error(parent->cc->ras->sess,
-                                           msg, status);
+                                           msg, status, file_pool);
         }
     }
 
@@ -1220,7 +1220,7 @@
     {
       const char *msg = apr_psprintf(pool, _("applying log message to %s"),
                                      baseline_rsrc.wr_url);
-      return svn_ra_dav__convert_error(cc->ras->sess, msg, rv);
+      return svn_ra_dav__convert_error(cc->ras->sess, msg, rv, pool);
     }
 
   return SVN_NO_ERROR;
Index: subversion/libsvn_ra_dav/fetch.c
===================================================================
--- subversion/libsvn_ra_dav/fetch.c	(revision 9742)
+++ subversion/libsvn_ra_dav/fetch.c	(arbetskopia)
@@ -464,7 +464,7 @@
        msg = apr_psprintf(pool, _("GET request failed for '%s'"), url);
        if (err)
          svn_error_clear (err);
-       err = svn_ra_dav__convert_error(sess, msg, decompress_rv);
+       err = svn_ra_dav__convert_error(sess, msg, decompress_rv, pool);
     }
   
   if (err)
Index: subversion/libsvn_ra_dav/util.c
===================================================================
--- subversion/libsvn_ra_dav/util.c	(revision 9742)
+++ subversion/libsvn_ra_dav/util.c	(arbetskopia)
@@ -26,6 +26,7 @@
 #include <ne_compress.h>
 
 #include "svn_string.h"
+#include "svn_utf.h"
 #include "svn_xml.h"
 #include "svn_path.h"
 #include "svn_config.h"
@@ -257,10 +258,12 @@
 
 svn_error_t *svn_ra_dav__convert_error(ne_session *sess,
                                        const char *context,
-                                       int retcode)
+                                       int retcode,
+                                       apr_pool_t *pool)
 {
   int errcode = SVN_ERR_RA_DAV_REQUEST_FAILED;
   const char *msg;
+  const char *hostport;
 
   /* Convert the return codes. */
   switch (retcode) 
@@ -279,15 +282,18 @@
       break;
 
     default:
-      /* Get the error string from neon. */
-      msg = ne_get_error (sess);
+      /* Get the error string from neon and convert to UTF-8. */
+      SVN_ERR (svn_utf_cstring_to_utf8 (&msg, ne_get_error (sess), pool));
       break;
     }
 
+  /* The hostname may contain non-ASCII characters, so convert it to UTF-8. */
+  SVN_ERR (svn_utf_cstring_to_utf8 (&hostport, ne_get_server_hostport(sess),
+                                    pool));
+
   return svn_error_createf (errcode, NULL, "%s: %s (%s://%s)", 
                             context, msg, ne_get_scheme(sess), 
-                            ne_get_server_hostport(sess));
-  
+                            hostport);
 }
 
 
@@ -638,7 +644,7 @@
       else
       {
         msg = apr_psprintf(pool, _("%s of '%s'"), method, url);
-        err = svn_ra_dav__convert_error(sess, msg, rv);
+        err = svn_ra_dav__convert_error(sess, msg, rv, pool);
       }
       goto cleanup;
     }
@@ -781,5 +787,5 @@
   /* We either have a neon error, or some other error
      that we didn't expect. */
   msg = apr_psprintf(pool, _("%s of '%s'"), method, url);
-  return svn_ra_dav__convert_error(session, msg, rv);
+  return svn_ra_dav__convert_error(session, msg, rv, pool);
 }
