]> git.lyx.org Git - features.git/commit
Thinking about it, it is better to always convert to docstrings all
authorEnrico Forestieri <forenr@lyx.org>
Sun, 23 Oct 2011 14:24:17 +0000 (14:24 +0000)
committerEnrico Forestieri <forenr@lyx.org>
Sun, 23 Oct 2011 14:24:17 +0000 (14:24 +0000)
commit8a4b25875ad32ffcd4013afbcd22bc15ce84148d
tree2f8d75f4f06b743e246311be72ab7bde8cd3d42e
parent5247de506c47fc6167f8e1cb3beee22109204313
Thinking about it, it is better to always convert to docstrings all
utf8 strings, and not only if they contain encoding changes. This is
because if the output encoding was previously changed and an utf8
string is inserted in the stream, the encoding changes cannot occur.
This was not a problem until now because normal strings could not be
inserted in a odocstream, as them would have been exchanged with encoding
changes. Indeed, the SetEnc struct has only a std::string member and
outputting a std::string would be interpreted by the compiler the same
as inserting setEncoding(std::string). However, a std::string can be
inserted in an otexstream and it is better to account for this.
I wonder whether trying "os << std::string", where os is an odocstream,
should produce an error instead of actually trying to change the stream
output encoding, but this has not been a problem until now...

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39944 a592a061-630c-0410-9148-cb99ea01b6c8
src/support/docstream.cpp