Move ucstring utf8 implementation to header

develop
kaetemi 4 years ago
parent 3dddc5ab40
commit 1300d5d4d4

@ -128,17 +128,7 @@ public:
}
/// Converts the controlled ucstring to a string str
void toString (std::string &str) const
{
str.resize (size ());
for (uint i = 0; i < str.size (); i++)
{
if (operator[](i) > 255)
str[i] = '?';
else
str[i] = (char) operator[](i);
}
}
void toString(std::string &str) const;
/// Converts the controlled ucstring and returns the resulting string
std::string toString () const

@ -17,6 +17,18 @@
#include "stdmisc.h"
#include "nel/misc/ucstring.h"
void ucstring::toString(std::string &str) const
{
str.resize(size());
for (uint i = 0; i < str.size (); i++)
{
if (operator[](i) > 255)
str[i] = '?';
else
str[i] = (char) operator[](i);
}
}
std::string ucstring::toUtf8() const
{
std::string res;

Loading…
Cancel
Save