Hash :
11d51ca6
Author :
Date :
2011-10-26T16:43:55
windows: Add support for non-UTF codepages Our previous assumption that all paths in Windows are encoded in UTF-8 is rather weak, specially when considering that Git is encoding-agnostic. These set of functions allow the user to change the library's active codepage globally, so it is possible to access paths and files on all international versions of Windows. Note that the default encoding here is UTF-8 because we assume that 99% of all Git repositories will be in UTF-8. Also, if you use non-ascii characters in paths, anywhere, please burn on a fire.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
/*
* Copyright (C) 2009-2011 the libgit2 contributors
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#ifndef INCLUDE_git_windows_h__
#define INCLUDE_git_windows_h__
#include "common.h"
/**
* @file git2/windows.h
* @brief Windows-specific functions
* @ingroup Git
* @{
*/
GIT_BEGIN_DECL
/**
* Set the active codepage for Windows syscalls
*
* All syscalls performed by the library will assume
* this codepage when converting paths and strings
* to use by the Windows kernel.
*
* The default value of UTF-8 will work automatically
* with most Git repositories created on Unix systems.
*
* This settings needs only be changed when working
* with repositories that contain paths in specific,
* non-UTF codepages.
*
* A full list of all available codepage identifiers may
* be found at:
*
* http://msdn.microsoft.com/en-us/library/windows/desktop/dd317756(v=vs.85).aspx
*
* @param codepage numeric codepage identifier
*/
GIT_EXTERN(void) gitwin_set_codepage(unsigned int codepage);
/**
* Return the active codepage for Windows syscalls
*
* @return numeric codepage identifier
*/
GIT_EXTERN(unsigned int) gitwin_get_codepage(void);
/**
* Set the active Windows codepage to UTF-8 (this is
* the default value)
*/
GIT_EXTERN(void) gitwin_set_utf8(void);
/** @} */
GIT_END_DECL
#endif