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
608a98c8
Commit
608a98c8
authored
Oct 17, 2013
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Charset: default filesystem charset is UTF-8
Implement a fast path for UTF-8 which leaves fs_charset empty, and don't assign a value to fs_charset if there's no configuration.
parent
f951e535
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
6 deletions
+8
-6
NEWS
NEWS
+1
-0
Charset.cxx
src/fs/Charset.cxx
+6
-0
Config.cxx
src/fs/Config.cxx
+1
-6
No files found.
NEWS
View file @
608a98c8
ver 0.18 (2012/??/??)
ver 0.18 (2012/??/??)
* configuration:
* configuration:
- allow tilde paths for socket
- allow tilde paths for socket
- default filesystem charset is UTF-8 instead of ISO-8859-1
* protocol:
* protocol:
- new command "toggleoutput"
- new command "toggleoutput"
- search for album artist falls back to the artist tag
- search for album artist falls back to the artist tag
...
...
src/fs/Charset.cxx
View file @
608a98c8
...
@@ -81,6 +81,9 @@ PathToUTF8(const char *path_fs)
...
@@ -81,6 +81,9 @@ PathToUTF8(const char *path_fs)
{
{
assert
(
path_fs
!=
nullptr
);
assert
(
path_fs
!=
nullptr
);
if
(
fs_charset
.
empty
())
return
std
::
string
(
path_fs
);
GIConv
conv
=
g_iconv_open
(
"utf-8"
,
fs_charset
.
c_str
());
GIConv
conv
=
g_iconv_open
(
"utf-8"
,
fs_charset
.
c_str
());
if
(
conv
==
reinterpret_cast
<
GIConv
>
(
-
1
))
if
(
conv
==
reinterpret_cast
<
GIConv
>
(
-
1
))
return
std
::
string
();
return
std
::
string
();
...
@@ -108,6 +111,9 @@ PathFromUTF8(const char *path_utf8)
...
@@ -108,6 +111,9 @@ PathFromUTF8(const char *path_utf8)
{
{
assert
(
path_utf8
!=
nullptr
);
assert
(
path_utf8
!=
nullptr
);
if
(
fs_charset
.
empty
())
return
g_strdup
(
path_utf8
);
return
g_convert
(
path_utf8
,
-
1
,
return
g_convert
(
path_utf8
,
-
1
,
fs_charset
.
c_str
(),
"utf-8"
,
fs_charset
.
c_str
(),
"utf-8"
,
nullptr
,
nullptr
,
nullptr
);
nullptr
,
nullptr
,
nullptr
);
...
...
src/fs/Config.cxx
View file @
608a98c8
...
@@ -60,11 +60,6 @@ ConfigureFS()
...
@@ -60,11 +60,6 @@ ConfigureFS()
#endif
#endif
}
}
if
(
charset
)
{
if
(
charset
!=
nullptr
)
SetFSCharset
(
charset
);
SetFSCharset
(
charset
);
}
else
{
LogDebug
(
path_domain
,
"setting filesystem charset to ISO-8859-1"
);
SetFSCharset
(
"ISO-8859-1"
);
}
}
}
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