Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-1.1
Commits
f0f90145
Commit
f0f90145
authored
Feb 14, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(Win32) Support stat() for file names outside ANSI Code Page
parent
5243d4df
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
src/misc/unicode.c
src/misc/unicode.c
+25
-8
No files found.
src/misc/unicode.c
View file @
f0f90145
...
...
@@ -297,15 +297,17 @@ FILE *utf8_fopen( const char *filename, const char *mode )
errno
=
ENOENT
;
return
NULL
;
#else
wchar_t
wpath
[
MAX_PATH
];
wchar_t
wmode
[
4
];
wchar_t
wpath
[
MAX_PATH
+
1
];
size_t
len
=
strlen
(
mode
)
+
1
;
wchar_t
wmode
[
len
];
if
(
!
MultiByteToWideChar
(
CP_UTF8
,
0
,
filename
,
-
1
,
wpath
,
MAX_PATH
-
1
)
||
!
MultiByteToWideChar
(
CP_ACP
,
0
,
mode
,
-
1
,
wmode
,
3
)
)
if
(
!
MultiByteToWideChar
(
CP_UTF8
,
0
,
filename
,
-
1
,
wpath
,
MAX_PATH
)
||
!
MultiByteToWideChar
(
CP_ACP
,
0
,
mode
,
len
,
wmode
,
len
)
)
{
errno
=
ENOENT
;
return
NULL
;
}
wpath
[
MAX_PATH
]
=
L'\0'
;
return
_wfopen
(
wpath
,
wmode
);
#endif
...
...
@@ -317,8 +319,8 @@ FILE *utf8_fopen( const char *filename, const char *mode )
int
utf8_mkdir
(
const
char
*
dirname
)
{
#if defined (UNDER_CE) || defined (WIN32)
wchar_t
wname
[
MAX_PATH
];
char
mod
[
MAX_PATH
];
wchar_t
wname
[
MAX_PATH
+
1
];
char
mod
[
MAX_PATH
+
1
];
int
i
;
/* Convert '/' into '\' */
...
...
@@ -341,6 +343,7 @@ int utf8_mkdir( const char *dirname )
errno
=
ENOENT
;
return
-
1
;
}
wname
[
MAX_PATH
]
=
L'\0'
;
if
(
CreateDirectoryW
(
wname
,
NULL
)
==
0
)
{
...
...
@@ -397,7 +400,8 @@ const char *utf8_readdir( void *dir )
static
int
utf8_statEx
(
const
char
*
filename
,
void
*
buf
,
vlc_bool_t
deref
)
{
#ifdef HAVE_SYS_STAT_H
#if !(defined (WIN32) || defined (UNDER_CE))
# ifdef HAVE_SYS_STAT_H
const
char
*
local_name
=
ToLocale
(
filename
);
if
(
local_name
!=
NULL
)
...
...
@@ -408,8 +412,21 @@ static int utf8_statEx( const char *filename, void *buf,
return
res
;
}
errno
=
ENOENT
;
#endif
# endif
return
-
1
;
#else
wchar_t
wpath
[
MAX_PATH
+
1
];
if
(
!
MultiByteToWideChar
(
CP_UTF8
,
0
,
filename
,
-
1
,
wpath
,
MAX_PATH
)
)
{
errno
=
ENOENT
;
return
-
1
;
}
wpath
[
MAX_PATH
]
=
L'\0'
;
/* struct _stat is just a silly Microsoft alias for struct stat */
return
_wstat
(
wpath
,
(
struct
_stat
*
)
buf
);
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment