diff options
author | Ben Straub <bs@github.com> | 2013-08-08 08:48:57 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-08-08 08:48:57 -0700 |
commit | aaefbdeea205fbea2005113a9743c81721a42b36 (patch) | |
tree | 8054ef69384be26ce48c6f6d8c8fbfc947eeb445 /src/win32/utf-conv.h | |
parent | 2c0128ee79243d32e60f19e60acc2e297c1761d6 (diff) | |
download | libgit2-aaefbdeea205fbea2005113a9743c81721a42b36.tar.gz |
Discriminate path-specific and general UTF-X conversions
Diffstat (limited to 'src/win32/utf-conv.h')
-rw-r--r-- | src/win32/utf-conv.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/win32/utf-conv.h b/src/win32/utf-conv.h index 4e602291e..7290f1d1a 100644 --- a/src/win32/utf-conv.h +++ b/src/win32/utf-conv.h @@ -16,8 +16,19 @@ typedef wchar_t git_win32_path_utf16[GIT_WIN_PATH_UTF16]; typedef char git_win32_path_utf8[GIT_WIN_PATH_UTF8]; -int git__utf8_to_16(git_win32_path_utf16 dest, const git_win32_path_utf8 src); -int git__utf16_to_8(git_win32_path_utf8 dest, const git_win32_path_utf16 src); +// dest_size is the size of dest in wchar_t's +int git__utf8_to_16(wchar_t * dest, size_t dest_size, const char *src); +// dest_size is the size of dest in char's +int git__utf16_to_8(char *dest, size_t dest_size, const wchar_t *src); -#endif +GIT_INLINE(int) git__win32_path_utf8_to_16(git_win32_path_utf16 dest, const git_win32_path_utf8 src) +{ + return git__utf8_to_16(dest, GIT_WIN_PATH_UTF16, src); +} + +GIT_INLINE(int) git__win32_path_utf16_to_8(git_win32_path_utf8 dest, const git_win32_path_utf16 src) +{ + return git__utf16_to_8(dest, GIT_WIN_PATH_UTF8, src); +} +#endif |