XML_Char


Subject: XML_Char
From: Mike Nordell (tamlin@algonet.se)
Date: Sun Dec 17 2000 - 21:02:15 CST


I just got to think of something interesting. Usually, XML_Char is typedef'd
to be a plain "char", but I take it it's used to be able to use wchar_t in
the future? If that's the case, almost none of our current code will work.

- What? you might say. Well, *many* functions take a pointer to XML_Char
instead of plain "char", forcing everyone to add casts to XML_Char* for all
strings literals they write (e.g. (XML_Char*)"foo" ).

1. If we ever start to use wchar_t this will obviously not work, we need to
add a macro "XML_TEXT" (or something like it) that evaluates the string
constant to either its native "char" form or to the wchar_t form (prepending
L to the string constant) and use that macro for *all* string constants that
we use. But then again, the C++ string literals have *nothing* to do with
XML.

2. If we're *never* to use wchar_t for many of these strings it's plain
wrong to use the XML_Char in the first place why I suggest we drop it from
many places.

Please not that there are exactly two string literal types: char and
wchar_t. Nothing more, nothing less. For C code there is only one C++
compatible string literal type: char.

Just to cure my ignorance, what really *is* and XML_Char? What is it to be
used for? Why do we use it for internal internal representations that
currently are of exacly one type; char, and in the future possibly one of
the two types char or wchar_t?

/Mike - please don't cc



This archive was generated by hypermail 2b25 : Sun Dec 17 2000 - 21:00:46 CST