Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 414429
Collapse All | Expand All

(-)subversion-1.7.4/subversion/include/svn_utf.h (-1 / +16 lines)
Lines 49-62 Link Here
49
 * Initialize the UTF-8 encoding/decoding routines.
49
 * Initialize the UTF-8 encoding/decoding routines.
50
 * Allocate cached translation handles in a subpool of @a pool.
50
 * Allocate cached translation handles in a subpool of @a pool.
51
 *
51
 *
52
 * If @a assume_native_utf8 is TRUE, the native character set is
53
 * assumed to be UTF-8, i.e. conversion is a no-op. This is useful
54
 * in contexts where the native character set is ASCII but UTF-8
55
 * should be used regardless (e.g. for mod_dav_svn which runs within
56
 * httpd and always uses the "C" locale).
57
 *
52
 * @note It is optional to call this function, but if it is used, no other
58
 * @note It is optional to call this function, but if it is used, no other
53
 * svn function may be in use in other threads during the call of this
59
 * svn function may be in use in other threads during the call of this
54
 * function or when @a pool is cleared or destroyed.
60
 * function or when @a pool is cleared or destroyed.
55
 * Initializing the UTF-8 routines will improve performance.
61
 * Initializing the UTF-8 routines will improve performance.
56
 *
62
 *
57
 * @since New in 1.1.
63
 * @since New in 1.8.
58
 */
64
 */
59
void
65
void
66
svn_utf_initialize2(apr_pool_t *pool,
67
		    svn_boolean_t assume_native_utf8);
68
/**
69
* Like svn_utf_initialize but without the ability to force the
70
* native encoding to UTF-8.
71
*
72
* @deprecated Provided with backwards compatibility with the 1.7 API.
73
*/
74
void
60
svn_utf_initialize(apr_pool_t *pool);
75
svn_utf_initialize(apr_pool_t *pool);
61
76
62
/** Set @a *dest to a utf8-encoded stringbuf from native stringbuf @a src;
77
/** Set @a *dest to a utf8-encoded stringbuf from native stringbuf @a src;
(-)subversion-1.7.4/subversion/libsvn_subr/cmdline.c (-1 / +1 lines)
Lines 220-226 Link Here
220
  /* Create a pool for use by the UTF-8 routines.  It will be cleaned
220
  /* Create a pool for use by the UTF-8 routines.  It will be cleaned
221
     up by APR at exit time. */
221
     up by APR at exit time. */
222
  pool = svn_pool_create(NULL);
222
  pool = svn_pool_create(NULL);
223
  svn_utf_initialize(pool);
223
  svn_utf_initialize2(pool, FALSE);
224
224
225
  if ((err = svn_nls_init()))
225
  if ((err = svn_nls_init()))
226
    {
226
    {
(-)subversion-1.7.4/subversion/libsvn_subr/deprecated.c (+7 lines)
Lines 39-44 Link Here
39
#include "svn_pools.h"
39
#include "svn_pools.h"
40
#include "svn_dso.h"
40
#include "svn_dso.h"
41
#include "svn_mergeinfo.h"
41
#include "svn_mergeinfo.h"
42
#include "svn_utf.h"
42
#include "svn_xml.h"
43
#include "svn_xml.h"
43
44
44
#include "opt.h"
45
#include "opt.h"
Lines 1126-1128 Link Here
1126
{
1127
{
1127
  svn_xml_make_header2(str, NULL, pool);
1128
  svn_xml_make_header2(str, NULL, pool);
1128
}
1129
}
1130
1131
void
1132
svn_utf_initialize(apr_pool_t *pool)
1133
{
1134
  svn_utf_initialize2(pool, FALSE);
1135
}
(-)subversion-1.7.4/subversion/libsvn_subr/utf.c (-4 / +15 lines)
Lines 23-28 Link Here
23
23
24
24
25
25
26
#include <stdlib.h>
26
#include <string.h>
27
#include <string.h>
27
#include <assert.h>
28
#include <assert.h>
28
29
Lines 52-57 Link Here
52
static const char *SVN_UTF_UTON_XLATE_HANDLE = "svn-utf-uton-xlate-handle";
53
static const char *SVN_UTF_UTON_XLATE_HANDLE = "svn-utf-uton-xlate-handle";
53
54
54
static const char *SVN_APR_UTF8_CHARSET = "UTF-8";
55
static const char *SVN_APR_UTF8_CHARSET = "UTF-8";
56
static svn_boolean_t assume_native_charset_is_utf8 = FALSE;
55
57
56
#if APR_HAS_THREADS
58
#if APR_HAS_THREADS
57
static apr_thread_mutex_t *xlate_handle_mutex = NULL;
59
static apr_thread_mutex_t *xlate_handle_mutex = NULL;
Lines 123-129 Link Here
123
}
125
}
124
126
125
void
127
void
126
svn_utf_initialize(apr_pool_t *pool)
128
svn_utf_initialize2(apr_pool_t *pool,
129
		    svn_boolean_t assume_native_utf8)
127
{
130
{
128
  apr_pool_t *subpool;
131
  apr_pool_t *subpool;
129
#if APR_HAS_THREADS
132
#if APR_HAS_THREADS
Lines 149-154 Link Here
149
      apr_pool_cleanup_register(subpool, NULL, xlate_cleanup,
152
      apr_pool_cleanup_register(subpool, NULL, xlate_cleanup,
150
                                apr_pool_cleanup_null);
153
                                apr_pool_cleanup_null);
151
    }
154
    }
155
156
    if (!assume_native_charset_is_utf8)
157
      assume_native_charset_is_utf8 = assume_native_utf8;
152
}
158
}
153
159
154
/* Return a unique string key based on TOPAGE and FROMPAGE.  TOPAGE and
160
/* Return a unique string key based on TOPAGE and FROMPAGE.  TOPAGE and
Lines 427-433 Link Here
427
get_ntou_xlate_handle_node(xlate_handle_node_t **ret, apr_pool_t *pool)
433
get_ntou_xlate_handle_node(xlate_handle_node_t **ret, apr_pool_t *pool)
428
{
434
{
429
  return get_xlate_handle_node(ret, SVN_APR_UTF8_CHARSET,
435
  return get_xlate_handle_node(ret, SVN_APR_UTF8_CHARSET,
430
                               SVN_APR_LOCALE_CHARSET,
436
  			       assume_native_charset_is_utf8
437
			         ? SVN_APR_UTF8_CHARSET
438
				 : SVN_APR_LOCALE_CHARSET,
431
                               SVN_UTF_NTOU_XLATE_HANDLE, pool);
439
                               SVN_UTF_NTOU_XLATE_HANDLE, pool);
432
}
440
}
433
441
Lines 440-447 Link Here
440
static svn_error_t *
448
static svn_error_t *
441
get_uton_xlate_handle_node(xlate_handle_node_t **ret, apr_pool_t *pool)
449
get_uton_xlate_handle_node(xlate_handle_node_t **ret, apr_pool_t *pool)
442
{
450
{
443
  return get_xlate_handle_node(ret, SVN_APR_LOCALE_CHARSET,
451
  return get_xlate_handle_node(ret, 
444
                               SVN_APR_UTF8_CHARSET,
452
                               assume_native_charset_is_utf8
453
			         ? SVN_APR_UTF8_CHARSET
454
				 : SVN_APR_LOCALE_CHARSET,
455
			       SVN_APR_UTF8_CHARSET,
445
                               SVN_UTF_UTON_XLATE_HANDLE, pool);
456
                               SVN_UTF_UTON_XLATE_HANDLE, pool);
446
}
457
}
447
458
(-)subversion-1.7.4/subversion/mod_dav_svn/mod_dav_svn.c (-1 / +24 lines)
Lines 22-27 Link Here
22
 * ====================================================================
22
 * ====================================================================
23
 */
23
 */
24
24
25
#include <stdlib.h>
25
#include <apr_strings.h>
26
#include <apr_strings.h>
26
27
27
#include <httpd.h>
28
#include <httpd.h>
Lines 55-60 Link Here
55
/* per-server configuration */
56
/* per-server configuration */
56
typedef struct server_conf_t {
57
typedef struct server_conf_t {
57
  const char *special_uri;
58
  const char *special_uri;
59
  svn_boolean_t use_utf8;
58
} server_conf_t;
60
} server_conf_t;
59
61
60
62
Lines 111-116 Link Here
111
init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
113
init(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
112
{
114
{
113
  svn_error_t *serr;
115
  svn_error_t *serr;
116
  server_conf_t *conf;
114
  ap_add_version_component(p, "SVN/" SVN_VER_NUMBER);
117
  ap_add_version_component(p, "SVN/" SVN_VER_NUMBER);
115
118
116
  serr = svn_fs_initialize(p);
119
  serr = svn_fs_initialize(p);
Lines 123-129 Link Here
123
    }
126
    }
124
127
125
  /* This returns void, so we can't check for error. */
128
  /* This returns void, so we can't check for error. */
126
  svn_utf_initialize(p);
129
  conf = ap_get_module_config(s->module_config, &dav_svn_module);
130
  svn_utf_initialize2(p, conf->use_utf8);
127
131
128
  return OK;
132
  return OK;
129
}
133
}
Lines 510-515 Link Here
510
  return NULL;
514
  return NULL;
511
}
515
}
512
516
517
static const char *
518
SVNUseUTF8_cmd(cmd_parms *cmd, void *config, int arg)
519
{
520
  server_conf_t *conf;
521
522
  conf = ap_get_module_config(cmd->server->module_config,
523
                              &dav_svn_module);
524
  conf->use_utf8 = arg;
525
526
  return NULL;
527
}
528
529
513
530
514
/** Accessor functions for the module's configuration state **/
531
/** Accessor functions for the module's configuration state **/
515
532
Lines 1021-1026 Link Here
1021
                "content over the network (0 for no compression, 9 for "
1038
                "content over the network (0 for no compression, 9 for "
1022
                "maximum, 5 is default)."),
1039
                "maximum, 5 is default)."),
1023
1040
1041
  /* per server */
1042
  AP_INIT_FLAG("SVNUseUTF8",
1043
               SVNUseUTF8_cmd, NULL,
1044
               RSRC_CONF,
1045
               "use UTF-8 as native character encoding (default is ASCII)."),
1046
1024
  { NULL }
1047
  { NULL }
1025
};
1048
};
1026
1049

Return to bug 414429