There aren't any disadvantages in using Glib::ustring, are there? These answers here http://unix.stackexchange.com/questions/2089/what-charset-encoding-is-used-f... suggest that there might very well be paths containing utf-8 characters. The problem with std::string is that size() and length() do not return the number of characters but the number of bytes.
Regards, Markus
-----Ursprüngliche Nachricht----- Von: Martin Owens [mailto:doctormo@...400...] Gesendet: Montag, 3. März 2014 23:37 An: Johan Engelen Cc: Inkscape-Devel Betreff: Re: [Inkscape-devel] Careful with C-strings!
On Mon, 2014-03-03 at 22:56 +0100, Johan Engelen wrote:
Perhaps you can create a helper/string.h file with all the string functions you need?
If I get more than 2, I'll do that.
(just thought of it now, but might be complete nonsense:) shouldn't the path stuff be implemented with glib::ustring, for paths that contain, say, Japanese characters?
KK believes different:
On Fri, 2014-02-07 at 15:40 +0100, Krzysztof Kosiński wrote:
Another thing to note is that std::string should only be used for paths. For UTF-8 strings, we should use Glib::ustring, which has a character-based index operator instead of a byte-based one.
On Fri, 2014-01-24 at 22:16 +0100, Krzysztof Kosiński wrote:
Eventually, all paths should be stored in std::string and all XML content, user-facing strings, and so on in Glib::ustring, but these tricks should help you get by in the meantime.
Jon Cruz: What say you, std::string or std::ustring for paths?
Martin,
------------------------------------------------------------------------------ Subversion Kills Productivity. Get off Subversion & Make the Move to Perforce. With Perforce, you get hassle-free workflows. Merge that actually works. Faster operations. Version large binaries. Built-in WAN optimization and the freedom to use Git, Perforce or both. Make the move to Perforce. http://pubads.g.doubleclick.net/gampad/clk?id=122218951&iu=/4140/ostg.cl... _______________________________________________ Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel