Skip to main content

svn_subst_translate_string2

Function svn_subst_translate_string2 

Source
pub unsafe extern "C" fn svn_subst_translate_string2(
    new_value: *mut *mut svn_string_t,
    translated_to_utf8: *mut svn_boolean_t,
    translated_line_endings: *mut svn_boolean_t,
    value: *const svn_string_t,
    encoding: *const c_char,
    repair: svn_boolean_t,
    result_pool: *mut apr_pool_t,
    scratch_pool: *mut apr_pool_t,
) -> *mut svn_error_t
Expand description

Translate the string @a value from character encoding @a encoding to UTF8, and also from its current line-ending style to LF line-endings. If @a encoding is @c NULL, translate from the system-default encoding.

If @a translated_to_utf8 is not @c NULL, then set @a *translated_to_utf8 to @c TRUE if at least one character of @a value in the source character encoding was translated to UTF-8, or to @c FALSE otherwise.

If @a translated_line_endings is not @c NULL, then set @a *translated_line_endings to @c TRUE if at least one line ending was changed to LF, or to @c FALSE otherwise.

If @a value has an inconsistent line ending style, then: if @a repair is @c FALSE, return @c SVN_ERR_IO_INCONSISTENT_EOL, else if @a repair is @c TRUE, convert any line ending in @a value to “\n” in @a *new_value. Recognized line endings are: “\n”, “\r”, and “\r\n”.

Set @a *new_value to the translated string, allocated in @a result_pool.

@a scratch_pool is used for temporary allocations.

@since New in 1.7.