Fix windows open for non-latin files

This commit is contained in:
Ron Pedde 2007-08-27 00:43:33 +00:00
parent d88132f6c9
commit 1ca5cef013
3 changed files with 7807 additions and 58 deletions

7853
ChangeLog

File diff suppressed because it is too large Load Diff

View File

@ -195,7 +195,6 @@ case $host in
AM_CONDITIONAL(COND_REND_POSIX,false);;
esac
dnl Checks for libraries.
AC_ARG_WITH(static-libs,
[--with-static-libs[[=DIR]] use static libs in DIR],[
@ -330,6 +329,9 @@ else
fi
CFLAGS=$oldcflags
AC_CHECK_LIB(iconv,libiconv,,
AC_CHECK_LIB(iconv,iconv,,echo "Must have iconv"; exit))
if test x$use_gdbm = xtrue; then
AC_CHECK_HEADERS(gdbm.h,, [
AC_MSG_ERROR([gdbm.h not found... Must have gdbm headers installed])])

View File

@ -1349,7 +1349,7 @@ int io_file_open(IO_PRIVHANDLE *phandle, char *uri) {
uint32_t native_mode=0;
#ifdef WIN32
uint32_t native_permissions=0;
WCHAR utf16_path[PATH_MAX+1]; /* the real windows utf16 path */
WCHAR *utf16_path; /* the real windows utf16 path */
#endif
ASSERT(phandle);
@ -1394,8 +1394,10 @@ int io_file_open(IO_PRIVHANDLE *phandle, char *uri) {
else
native_mode |= OPEN_EXISTING;
priv->fd = CreateFile(uri,native_permissions,FILE_SHARE_READ,NULL,
native_mode,FILE_ATTRIBUTE_NORMAL,NULL);
utf16_path = (WCHAR *)util_utf8toutf16_alloc(uri);
priv->fd = CreateFileW(utf16_path,native_permissions,FILE_SHARE_READ,NULL,
native_mode,FILE_ATTRIBUTE_NORMAL,NULL);
free(utf16_path);
if(priv->fd == INVALID_HANDLE_VALUE) {
io_file_seterr(phandle,IO_E_FILE_OTHER);
return FALSE;