Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
73bd6af0
Commit
73bd6af0
authored
Jun 22, 2015
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Charset: hard-code Windows to ACP
Don't define HAVE_FS_CHARSET, and make GetFSCharset() return "ACP" instead of "UTF-8". Ignore the configuration setting, which had no effect anyway.
parent
2aa54c53
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
15 deletions
+5
-15
Charset.cxx
src/fs/Charset.cxx
+2
-0
Charset.hxx
src/fs/Charset.hxx
+1
-1
Config.cxx
src/fs/Config.cxx
+2
-14
No files found.
src/fs/Charset.cxx
View file @
73bd6af0
...
...
@@ -71,6 +71,8 @@ GetFSCharset()
{
#ifdef HAVE_FS_CHARSET
return
fs_charset
.
empty
()
?
"UTF-8"
:
fs_charset
.
c_str
();
#elif defined(WIN32)
return
"ACP"
;
#else
return
"UTF-8"
;
#endif
...
...
src/fs/Charset.hxx
View file @
73bd6af0
...
...
@@ -24,7 +24,7 @@
#include "Compiler.h"
#include "Traits.hxx"
#if
defined(HAVE_ICU) || defined(HAVE_GLIB
)
#if
(defined(HAVE_ICU) || defined(HAVE_GLIB)) && !defined(WIN32
)
#define HAVE_FS_CHARSET
#endif
...
...
src/fs/Config.cxx
View file @
73bd6af0
...
...
@@ -22,10 +22,7 @@
#include "Charset.hxx"
#include "config/ConfigGlobal.hxx"
#ifdef WIN32
#include <windows.h> // for GetACP()
#include <stdio.h> // for sprintf()
#elif defined(HAVE_GLIB)
#ifdef HAVE_GLIB
#include <glib.h>
#endif
...
...
@@ -37,16 +34,7 @@ ConfigureFS(Error &error)
charset
=
config_get_string
(
ConfigOption
::
FS_CHARSET
,
nullptr
);
if
(
charset
==
nullptr
)
{
#ifdef WIN32
/* Glib claims that file system encoding is always utf-8
* on native Win32 (i.e. not Cygwin).
* However this is true only if <gstdio.h> helpers are used.
* MPD uses regular <stdio.h> functions.
* Those functions use encoding determined by GetACP(). */
static
char
win_charset
[
13
];
sprintf
(
win_charset
,
"cp%u"
,
GetACP
());
charset
=
win_charset
;
#elif defined(HAVE_GLIB)
#ifdef HAVE_GLIB
const
gchar
**
encodings
;
g_get_filename_charsets
(
&
encodings
);
...
...
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