bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Assertion failed


From: Juergen Sauermann
Subject: Re: [Bug-apl] Assertion failed
Date: Tue, 1 Aug 2017 13:04:44 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.2.0

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 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]