Enrico Forestieri wrote:
On Wed, Oct 31, 2007 at 08:22:44AM +0100, Abdelrazak Younes wrote:
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.

Uh?

Something you didn't understand in my explanation?

I mean that if the passed something that is not strictly ASCII we may have problem later. So, WRT your patch, I'll add an assertion there to make sure this won't happen:

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)
+{
+    BOOST_ASSERT(c < 0x80);
+    os.put(c);
+    return os;
+}
+

Clearer?

Abdel.

Reply via email to