mirror of https://github.com/OpenTTD/OpenTTD
Add: std::back_insert_iterator<std::string> Utf8Encode function
parent
55dfca1936
commit
ce8933d63e
|
@ -672,6 +672,11 @@ size_t Utf8Encode(std::ostreambuf_iterator<char> &buf, WChar c)
|
||||||
return Utf8Encode<std::ostreambuf_iterator<char> &>(buf, c);
|
return Utf8Encode<std::ostreambuf_iterator<char> &>(buf, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size_t Utf8Encode(std::back_insert_iterator<std::string> &buf, WChar c)
|
||||||
|
{
|
||||||
|
return Utf8Encode<std::back_insert_iterator<std::string> &>(buf, c);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Properly terminate an UTF8 string to some maximum length
|
* Properly terminate an UTF8 string to some maximum length
|
||||||
* @param s string to check if it needs additional trimming
|
* @param s string to check if it needs additional trimming
|
||||||
|
|
|
@ -94,6 +94,7 @@ bool IsValidChar(WChar key, CharSetFilter afilter);
|
||||||
size_t Utf8Decode(WChar *c, const char *s);
|
size_t Utf8Decode(WChar *c, const char *s);
|
||||||
size_t Utf8Encode(char *buf, WChar c);
|
size_t Utf8Encode(char *buf, WChar c);
|
||||||
size_t Utf8Encode(std::ostreambuf_iterator<char> &buf, WChar c);
|
size_t Utf8Encode(std::ostreambuf_iterator<char> &buf, WChar c);
|
||||||
|
size_t Utf8Encode(std::back_insert_iterator<std::string> &buf, WChar c);
|
||||||
size_t Utf8TrimString(char *s, size_t maxlen);
|
size_t Utf8TrimString(char *s, size_t maxlen);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue