PIIOTextStream for strings fix
This commit is contained in:
@@ -356,15 +356,16 @@ PIString PIString::fromSystem(const char * s) {
|
||||
}
|
||||
|
||||
|
||||
PIString PIString::fromUTF8(const char * s) {
|
||||
PIString PIString::fromUTF8(const char * s, int l) {
|
||||
PIString ret;
|
||||
if (!s) return ret;
|
||||
if (s[0] != '\0') {
|
||||
if ((uchar)s[0] == 0xEF && (uchar)s[1] == 0xBB && (uchar)s[2] == 0xBF) {
|
||||
s += 3;
|
||||
if (l > 0) l -= 3;
|
||||
if (s[0] == '\0') return ret;
|
||||
}
|
||||
ret.appendFromChars(s, -1, __utf8name__);
|
||||
ret.appendFromChars(s, l, __utf8name__);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user