Enrico Forestieri wrote:
On Tue, Oct 30, 2007 at 06:26:45PM +0100, Jürgen Spitzmüller wrote:
http://bugzilla.lyx.org/show_bug.cgi?id=4147
The bug is the result of an encoding failure (use of char instead of
char_type) that results in an unwanted conversion of a tabulator ('\t') to
the digit '9'.
I'll commit to branch and trunk on Friday if I get no objections.
This is not going to work on systems where sizeof(wchar_t) == 2.
I have attached a better fix to bug 4147 on bugzilla.
I'm afraid your patch could have some bad effect and could hide future
bugs because the stream is not strongly typed anymore. I am not sure
about that but please make sure that is not the case.
Abdel.
PS: Enrico's patch:
Index: src/support/docstream.h
===================================================================
--- src/support/docstream.h (revision 21296)
+++ src/support/docstream.h (working copy)
@@ -77,6 +77,13 @@ odocstream & operator<<(odocstream & os,
return os;
}
+inline
+odocstream & operator<<(odocstream & os, unsigned char c)
+{
+ os.put(c);
+ return os;
+}
+
/// Helper struct for changing stream encoding
struct SetEnc {
SetEnc(std::string const & e) : encoding(e) {}