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
03cd8e02
Commit
03cd8e02
authored
Feb 21, 2006
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Favor libiconv over Win32 API for *Locale
parent
a69be9de
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
src/misc/unicode.c
src/misc/unicode.c
+18
-13
No files found.
src/misc/unicode.c
View file @
03cd8e02
...
...
@@ -51,16 +51,17 @@
# define ASSUME_UTF8 1
#endif
#if !(defined (WIN32) || defined (UNDER_CE) || defined (ASSUME_UTF8))
# define USE_ICONV 1
#endif
#if defined (USE_ICONV) && !defined (HAVE_ICONV)
# error No UTF8 charset conversion implemented on this platform!
#ifndef ASSUME_UTF8
# if defined (HAVE_ICONV)
/* libiconv is more powerful than Win32 API (it has translit) */
# define USE_ICONV 1
# elif defined (WIN32) || defined (UNDER_CE)
# define USE_MB2MB 1
# else
# error No UTF8 charset conversion implemented on this platform!
# endif
#endif
#ifdef USE_ICONV
static
struct
{
vlc_iconv_t
hd
;
...
...
@@ -126,7 +127,7 @@ void LocaleDeinit( void )
#endif
}
#if
defined (WIN32) || defined (UNDER_CE)
#if
def USE_MB2MB
static
char
*
MB2MB
(
const
char
*
string
,
UINT
fromCP
,
UINT
toCP
)
{
char
*
out
;
...
...
@@ -158,7 +159,7 @@ char *FromLocale( const char *locale )
if
(
locale
==
NULL
)
return
NULL
;
#if
!(defined WIN32 || defined (UNDER_CE))
#if
ndef USE_MB2MB
# ifdef USE_ICONV
if
(
from_locale
.
hd
!=
(
vlc_iconv_t
)(
-
1
)
)
{
...
...
@@ -201,7 +202,7 @@ char *FromLocale( const char *locale )
}
# endif
/* USE_ICONV */
return
(
char
*
)
locale
;
#else
/*
WIN32
*/
#else
/*
MB2MB
*/
return
MB2MB
(
locale
,
CP_ACP
,
CP_UTF8
);
#endif
}
...
...
@@ -228,7 +229,7 @@ char *ToLocale( const char *utf8 )
if
(
utf8
==
NULL
)
return
NULL
;
#if
!(defined (WIN32) || defined (UNDER_CE))
#if
ndef USE_MB2MB
# ifdef USE_ICONV
if
(
to_locale
.
hd
!=
(
vlc_iconv_t
)(
-
1
)
)
{
...
...
@@ -268,7 +269,7 @@ char *ToLocale( const char *utf8 )
}
# endif
/* USE_ICONV */
return
(
char
*
)
utf8
;
#else
/*
WIN32
*/
#else
/*
MB2MB
*/
return
MB2MB
(
utf8
,
CP_UTF8
,
CP_ACP
);
#endif
}
...
...
@@ -329,6 +330,10 @@ FILE *utf8_fopen( const char *filename, const char *mode )
}
wpath
[
MAX_PATH
]
=
L'\0'
;
/*
* fopen() cannot open files with non-“ANSI” characters on Windows.
* We use _wfopen() instead. Same thing for mkdir() and stat().
*/
return
_wfopen
(
wpath
,
wmode
);
#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