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
790304ab
Commit
790304ab
authored
Aug 04, 2005
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up LocaleFree()
parent
91fcb101
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
12 deletions
+10
-12
src/misc/unicode.c
src/misc/unicode.c
+10
-12
No files found.
src/misc/unicode.c
View file @
790304ab
...
...
@@ -27,6 +27,10 @@
#include <vlc/vlc.h>
#include "charset.h"
/* Evil global variable */
static
vlc_bool_t
native_utf8
;
/*****************************************************************************
* FromLocale: converts a locale string to UTF-8
*****************************************************************************/
...
...
@@ -38,7 +42,8 @@ char *FromLocale( const char *locale )
if
(
locale
==
NULL
)
return
NULL
;
if
(
!
vlc_current_charset
(
&
psz_charset
)
)
native_utf8
=
vlc_current_charset
(
&
psz_charset
);
if
(
!
native_utf8
)
{
char
*
iptr
=
(
char
*
)
locale
,
*
output
,
*
optr
;
size_t
inb
,
outb
;
...
...
@@ -78,7 +83,8 @@ char *ToLocale( const char *utf8 )
if
(
utf8
==
NULL
)
return
NULL
;
if
(
!
vlc_current_charset
(
&
psz_charset
)
)
native_utf8
=
vlc_current_charset
(
&
psz_charset
);
if
(
!
native_utf8
)
{
char
*
iptr
=
(
char
*
)
utf8
,
*
output
,
*
optr
;
size_t
inb
,
outb
;
...
...
@@ -109,16 +115,8 @@ char *ToLocale( const char *utf8 )
void
LocaleFree
(
const
char
*
str
)
{
if
(
str
!=
NULL
)
{
/* FIXME: this deserve a price for the most inefficient peice of code */
char
*
psz_charset
;
if
(
!
vlc_current_charset
(
&
psz_charset
)
)
free
(
(
char
*
)
str
);
free
(
psz_charset
);
}
if
(
(
str
!=
NULL
)
&&
(
!
native_utf8
)
)
free
(
(
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