[Ecls-list] unicode troubles
Арсений Заостровных
necto.ne at gmail.com
Mon Jul 23 06:23:16 UTC 2012
Thank you for a solution.
But is there any way to force ecl use utf-8 instead of utf-32, and in
simple english case be the same as ascii? May be it has some special
functions to work exactly with specified encoding?
2012/7/23 Polos Ruetz <polos.ruetz at gmail.com>
> 2012/7/22, Арсений Заостровных <necto.ne at gmail.com>:
> > std::string outStr = (char*)princed->base_string.
>
> This code is taken from "EQL" and converts from/to a QString.
> (But maybe there's a better way.)
>
> cl_object from_qstring(const QString& s)
> {
> cl_object l_s = ecl_alloc_simple_extended_string(s.length());
> ecl_character* l_p = l_s->string.self;
> for(int i = 0; i < s.length(); ++i) {
> l_p[i] = s.at(i).unicode();
> }
> return l_s;
> }
>
>
> QString toQString(cl_object l_str)
> {
> QString s;
> if(ECL_STRINGP(l_str)) {
> if(ECL_BASE_STRING_P(l_str)) {
> s = QString::fromLatin1((char*)l_str->base_string.self,
> l_str->base_string.fillp);
> }
> else {
> uint l = l_str->string.fillp;
> s.reserve(l);
> ecl_character* l_s = l_str->string.self;
> for(uint i = 0; i < l; ++i) {
> s[i] = QChar(l_s[i]);
> }
> }
> }
> return s;
> }
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Ecls-list mailing list
> Ecls-list at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/ecls-list
>
--
Necto.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20120723/03367d90/attachment.html>
More information about the ecl-devel
mailing list