std::vector<lyx::char_type> utf8_to_ucs4(std::vector<char> const & utf8str)
{
std::vector<lyx::char_type> utf8_to_ucs4(std::vector<char> const & utf8str)
{
+ if (utf8str.empty())
+ return std::vector<lyx::char_type>();
+
return utf8_to_ucs4(&utf8str[0], utf8str.size());
}
return utf8_to_ucs4(&utf8str[0], utf8str.size());
}
std::vector<lyx::char_type>
ucs2_to_ucs4(std::vector<unsigned short> const & ucs2str)
{
std::vector<lyx::char_type>
ucs2_to_ucs4(std::vector<unsigned short> const & ucs2str)
{
+ if (ucs2str.empty())
+ return std::vector<lyx::char_type>();
+
return ucs2_to_ucs4(&ucs2str[0], ucs2str.size());
}
return ucs2_to_ucs4(&ucs2str[0], ucs2str.size());
}
std::vector<unsigned short>
ucs4_to_ucs2(std::vector<lyx::char_type> const & ucs4str)
{
std::vector<unsigned short>
ucs4_to_ucs2(std::vector<lyx::char_type> const & ucs4str)
{
+ if (ucs4str.empty())
+ return std::vector<unsigned short>();
+
return ucs4_to_ucs2(&ucs4str[0], ucs4str.size());
}
return ucs4_to_ucs2(&ucs4str[0], ucs4str.size());
}
std::vector<char>
ucs4_to_utf8(std::vector<lyx::char_type> const & ucs4str)
{
std::vector<char>
ucs4_to_utf8(std::vector<lyx::char_type> const & ucs4str)
{
+ if (ucs4str.empty())
+ return std::vector<char>();
+
return ucs4_to_utf8(&ucs4str[0], ucs4str.size());
}
return ucs4_to_utf8(&ucs4str[0], ucs4str.size());
}