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
7a98a784
Commit
7a98a784
authored
Apr 24, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fs/Features: add macro FS_CHARSET_ALWAYS_UTF8
parent
162845cc
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
6 deletions
+13
-6
AllocatedPath.cxx
src/fs/AllocatedPath.cxx
+6
-6
Features.hxx
src/fs/Features.hxx
+7
-0
No files found.
src/fs/AllocatedPath.cxx
View file @
7a98a784
...
@@ -32,24 +32,24 @@ AllocatedPath::~AllocatedPath() noexcept = default;
...
@@ -32,24 +32,24 @@ AllocatedPath::~AllocatedPath() noexcept = default;
AllocatedPath
AllocatedPath
AllocatedPath
::
FromUTF8
(
const
char
*
path_utf8
)
noexcept
AllocatedPath
::
FromUTF8
(
const
char
*
path_utf8
)
noexcept
{
{
#if defined(HAVE_FS_CHARSET) || defined(_WIN32)
#ifdef FS_CHARSET_ALWAYS_UTF8
return
FromFS
(
path_utf8
);
#else
try
{
try
{
return
AllocatedPath
(
::
PathFromUTF8
(
path_utf8
));
return
AllocatedPath
(
::
PathFromUTF8
(
path_utf8
));
}
catch
(...)
{
}
catch
(...)
{
return
nullptr
;
return
nullptr
;
}
}
#else
return
FromFS
(
path_utf8
);
#endif
#endif
}
}
AllocatedPath
AllocatedPath
AllocatedPath
::
FromUTF8Throw
(
const
char
*
path_utf8
)
AllocatedPath
::
FromUTF8Throw
(
const
char
*
path_utf8
)
{
{
#if defined(HAVE_FS_CHARSET) || defined(_WIN32)
#ifdef FS_CHARSET_ALWAYS_UTF8
return
AllocatedPath
(
::
PathFromUTF8
(
path_utf8
));
#else
return
FromFS
(
path_utf8
);
return
FromFS
(
path_utf8
);
#else
return
AllocatedPath
(
::
PathFromUTF8
(
path_utf8
));
#endif
#endif
}
}
...
...
src/fs/Features.hxx
View file @
7a98a784
...
@@ -26,4 +26,11 @@
...
@@ -26,4 +26,11 @@
#define HAVE_FS_CHARSET
#define HAVE_FS_CHARSET
#endif
#endif
#if !defined(HAVE_FS_CHARSET) && !defined(_WIN32)
/**
* Is the filesystem character set hard-coded to UTF-8?
*/
#define FS_CHARSET_ALWAYS_UTF8
#endif
#endif
#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