fix unicode handling in is_regular_file check - refs #2273
This commit is contained in:
parent
5688a93858
commit
184d9dd43b
3 changed files with 11 additions and 1 deletions
|
@ -33,6 +33,7 @@ namespace mapnik { namespace util {
|
||||||
|
|
||||||
MAPNIK_DECL bool exists(std::string const& value);
|
MAPNIK_DECL bool exists(std::string const& value);
|
||||||
MAPNIK_DECL bool is_directory(std::string const& value);
|
MAPNIK_DECL bool is_directory(std::string const& value);
|
||||||
|
MAPNIK_DECL bool is_regular_file(std::string const& value);
|
||||||
MAPNIK_DECL bool remove(std::string const& value);
|
MAPNIK_DECL bool remove(std::string const& value);
|
||||||
MAPNIK_DECL bool is_relative(std::string const& value);
|
MAPNIK_DECL bool is_relative(std::string const& value);
|
||||||
MAPNIK_DECL std::string make_relative(std::string const& filepath, std::string const& base);
|
MAPNIK_DECL std::string make_relative(std::string const& filepath, std::string const& base);
|
||||||
|
|
|
@ -213,7 +213,7 @@ bool freetype_engine::register_fonts_impl(std::string const& dir, FT_LibraryRec_
|
||||||
std::string base_name = itr->filename();
|
std::string base_name = itr->filename();
|
||||||
#endif
|
#endif
|
||||||
if (!boost::algorithm::starts_with(base_name,".") &&
|
if (!boost::algorithm::starts_with(base_name,".") &&
|
||||||
boost::filesystem::is_regular_file(file_name) &&
|
mapnik::util::is_regular_file(file_name) &&
|
||||||
is_font_file(file_name))
|
is_font_file(file_name))
|
||||||
{
|
{
|
||||||
if (mapnik::freetype_engine::register_font_impl(file_name, library))
|
if (mapnik::freetype_engine::register_font_impl(file_name, library))
|
||||||
|
|
|
@ -88,6 +88,15 @@ namespace util {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool is_regular_file(std::string const& filepath)
|
||||||
|
{
|
||||||
|
#ifdef _WINDOWS
|
||||||
|
return boost::filesystem::is_regular_file(mapnik::utf8_to_utf16(filepath));
|
||||||
|
#else
|
||||||
|
return boost::filesystem::is_regular_file(filepath);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
bool remove(std::string const& filepath)
|
bool remove(std::string const& filepath)
|
||||||
{
|
{
|
||||||
#ifdef _WINDOWS
|
#ifdef _WINDOWS
|
||||||
|
|
Loading…
Add table
Reference in a new issue