Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added missing mapnik::value to std::wstring conversions

  • Loading branch information...
commit eda5386b3fb8cf5a9ed6a0a778e8f409fe62f5bb 1 parent 2d25616
@artemp artemp authored
Showing with 12 additions and 8 deletions.
  1. +12 −8 include/mapnik/value.hpp
View
20 include/mapnik/value.hpp
@@ -347,15 +347,16 @@ namespace mapnik {
for (;pos!=val.end();++pos)
{
wchar_t c = *pos;
- if (c < 0x7f)
+ if (c < 0x80)
{
ss << char(c);
}
else
{
ss << "\\x";
- ss << ((c >> 8) & 0xff);
- ss << (c & 0xff);
+ unsigned c0 = (c >> 8) & 0xff;
+ if (c0) ss << c0;
+ ss << (c & 0xff);
}
}
return ss.str();
@@ -375,7 +376,9 @@ namespace mapnik {
template <typename T>
std::wstring operator() (T val) const
{
- return L"TODO";
+ std::basic_ostringstream<wchar_t> out;
+ out << val;
+ return out.str();
}
// specializations
std::wstring const& operator() (std::wstring const& val) const
@@ -394,18 +397,19 @@ namespace mapnik {
for (;pos!=val.end();++pos)
{
wchar_t c = *pos;
- if (c < 0x7f)
+ if (c < 0x80)
{
ss << char(c);
}
else
{
ss << "\\x";
- ss << ((c >> 8) & 0xff);
- ss << (c & 0xff);
+ unsigned c0 = (c >> 8) & 0xff;
+ if (c0) ss << c0;
+ ss << (c & 0xff);
}
}
- return ss.str();
+ return "\'" + ss.str() + "\'";
}
template <typename T>
Please sign in to comment.
Something went wrong with that request. Please try again.