input/Open: convert UTF-8 to filesystem charset for OpenLocalInputStream()
This commit is contained in:
parent
758e969cb6
commit
ddec10d494
@ -26,6 +26,7 @@
|
|||||||
#include "plugins/RewindInputPlugin.hxx"
|
#include "plugins/RewindInputPlugin.hxx"
|
||||||
#include "fs/Traits.hxx"
|
#include "fs/Traits.hxx"
|
||||||
#include "fs/Path.hxx"
|
#include "fs/Path.hxx"
|
||||||
|
#include "fs/AllocatedPath.hxx"
|
||||||
#include "util/Error.hxx"
|
#include "util/Error.hxx"
|
||||||
#include "util/Domain.hxx"
|
#include "util/Domain.hxx"
|
||||||
|
|
||||||
@ -34,10 +35,14 @@ InputStream::Open(const char *url,
|
|||||||
Mutex &mutex, Cond &cond,
|
Mutex &mutex, Cond &cond,
|
||||||
Error &error)
|
Error &error)
|
||||||
{
|
{
|
||||||
if (PathTraitsUTF8::IsAbsolute(url))
|
if (PathTraitsUTF8::IsAbsolute(url)) {
|
||||||
/* TODO: the parameter is UTF-8, not filesystem charset */
|
const auto path = AllocatedPath::FromUTF8(url, error);
|
||||||
return OpenLocalInputStream(Path::FromFS(url),
|
if (path.IsNull())
|
||||||
|
return nullptr;
|
||||||
|
|
||||||
|
return OpenLocalInputStream(path,
|
||||||
mutex, cond, error);
|
mutex, cond, error);
|
||||||
|
}
|
||||||
|
|
||||||
input_plugins_for_each_enabled(plugin) {
|
input_plugins_for_each_enabled(plugin) {
|
||||||
InputStream *is;
|
InputStream *is;
|
||||||
|
Loading…
Reference in New Issue
Block a user