|
From: | Elias Mårtenson |
Subject: | Re: [Bug-apl] Assertion failed |
Date: | Tue, 8 Aug 2017 15:28:43 +0800 |
Hi Elias,
I don't know what Ala'a did. However, looking at:
/// return a UTF8 encoded std:string
inline std::string to_string(const UCS_string & ucs)
{
const UTF8_string utf(ucs);
return string((const char *)&utf[0], utf.size());
}
I am not sure what happens if string ucs is empty (in that case ucs[0] does not
exist and may be makes &ucs[0] also 0. The std::string constructor then looks
for the terminating 0 character in a 0-pointer. Using UTF8:string::c_str() might
be better.
Also converting a UCS or UTF8 string to std::string just for outputting it with << may be
an overkill, since ostream << often (read: after #include "PrintOperator.hh") understands
UCF and UCS strings directly.
/// Jürgen
On 07/31/2017 02:31 AM, Elias Mårtenson wrote:
Can you tell me exactly what you are doing in order to reproduce the problem?
Regards,Elias
[Prev in Thread] | Current Thread | [Next in Thread] |