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 |
|