Re: [gtkmm] Glib::ustring -> int



> Do you know whether this is also guaranteed to work with user input?
> Or are there be other unicode characters apart from 0123456789 for
> other languages (like Chinese) that make up numeric values and
> wouldn't be converted correctly?

Good question.  I'm afraid I don't know.   (But since I'm guessing someone
reading this list will know for certain, I won't speculate).

> If yes, do you think
>    long x = boost::lexical_cast<long>(Glib::locale_from_utf8(s))
> should work for every case?

Again, I'm not sure, and won't attempt to guess...

Perhaps lexical_cast isn't a good approach when are variety of languages may
be involved.  (But at least it still cleaner and easier than using a
stringstream explicitly).

Dan






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