Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
08936b3b
Commit
08936b3b
authored
Nov 21, 2006
by
Rafaël Carré
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Unicode support in directory access on windows. Patch by xxcv. Untested.
parent
e77b5163
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
4 deletions
+24
-4
src/extras/libc.c
src/extras/libc.c
+13
-3
src/misc/unicode.c
src/misc/unicode.c
+11
-1
No files found.
src/extras/libc.c
View file @
08936b3b
...
@@ -416,7 +416,17 @@ void *vlc_opendir_wrapper( const char *psz_path )
...
@@ -416,7 +416,17 @@ void *vlc_opendir_wrapper( const char *psz_path )
return
(
void
*
)
p_dir
;
return
(
void
*
)
p_dir
;
}
}
p_real_dir
=
opendir
(
psz_path
);
if
(
GetVersion
()
<
0x80000000
)
{
/* for Windows NT and above */
wchar_t
wpath
[
MAX_PATH
+
1
];
if
(
!
MultiByteToWideChar
(
CP_UTF8
,
0
,
psz_path
,
-
1
,
wpath
,
MAX_PATH
))
return
NULL
;
wpath
[
MAX_PATH
]
=
L'\0'
;
p_real_dir
=
_wopendir
(
wpath
);
}
if
(
p_real_dir
==
NULL
)
if
(
p_real_dir
==
NULL
)
return
NULL
;
return
NULL
;
...
@@ -445,7 +455,7 @@ struct dirent *vlc_readdir_wrapper( void *_p_dir )
...
@@ -445,7 +455,7 @@ struct dirent *vlc_readdir_wrapper( void *_p_dir )
return
&
p_dir
->
dd_dir
;
return
&
p_dir
->
dd_dir
;
}
}
return
readdir
(
p_dir
->
p_real_dir
);
return
_w
readdir
(
p_dir
->
p_real_dir
);
}
}
/* Drive letters mode */
/* Drive letters mode */
...
@@ -471,7 +481,7 @@ int vlc_closedir_wrapper( void *_p_dir )
...
@@ -471,7 +481,7 @@ int vlc_closedir_wrapper( void *_p_dir )
if
(
p_dir
->
p_real_dir
!=
NULL
)
if
(
p_dir
->
p_real_dir
!=
NULL
)
{
{
int
i_ret
=
closedir
(
p_dir
->
p_real_dir
);
int
i_ret
=
_w
closedir
(
p_dir
->
p_real_dir
);
free
(
p_dir
);
free
(
p_dir
);
return
i_ret
;
return
i_ret
;
}
}
...
...
src/misc/unicode.c
View file @
08936b3b
...
@@ -429,7 +429,11 @@ int utf8_mkdir( const char *dirname )
...
@@ -429,7 +429,11 @@ int utf8_mkdir( const char *dirname )
void
*
utf8_opendir
(
const
char
*
dirname
)
void
*
utf8_opendir
(
const
char
*
dirname
)
{
{
/* TODO: support for WinNT non-ACP filenames */
#if defined (UNDER_CE) || defined (WIN32)
DIR
*
dir
=
vlc_opendir_wrapper
(
dirname
);
return
dir
;
#else
const
char
*
local_name
=
ToLocale
(
dirname
);
const
char
*
local_name
=
ToLocale
(
dirname
);
if
(
local_name
!=
NULL
)
if
(
local_name
!=
NULL
)
...
@@ -440,6 +444,8 @@ void *utf8_opendir( const char *dirname )
...
@@ -440,6 +444,8 @@ void *utf8_opendir( const char *dirname )
}
}
else
else
errno
=
ENOENT
;
errno
=
ENOENT
;
#endif
return
NULL
;
return
NULL
;
}
}
...
@@ -452,7 +458,11 @@ char *utf8_readdir( void *dir )
...
@@ -452,7 +458,11 @@ char *utf8_readdir( void *dir )
if
(
ent
==
NULL
)
if
(
ent
==
NULL
)
return
NULL
;
return
NULL
;
#if defined (UNDER_CE) || defined (WIN32)
return
FromWide
(
ent
->
d_name
);
#else
return
vlc_fix_readdir
(
ent
->
d_name
);
return
vlc_fix_readdir
(
ent
->
d_name
);
#endif
}
}
static
int
dummy_select
(
const
char
*
str
)
static
int
dummy_select
(
const
char
*
str
)
...
...
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