I added it because of a misunderstanding. If the encoding is really set too
late, to_utf8() in the Token constructor would probably fail, but a non-empty
putback buffer is no problem, since it was always created via to_utf8() ->
from_utf8().
// Wrapper
//
-bool iparserdocstream::setEncoding(std::string const & e)
+void iparserdocstream::setEncoding(std::string const & e)
{
is_ << lyx::setEncoding(e);
- if (s_.empty())
- return true;
- cerr << "Setting encoding " << e << " too late. The encoding of `"
- << to_utf8(s_) << "ยด is wrong." << std::endl;
- return false;
}
{
//cerr << "setting encoding to " << e << std::endl;
encoding_iconv_ = e;
- return is_.setEncoding(e);
+ is_.setEncoding(e);
+ return true;
}
operator bool() const { return s_.empty() ? is_ : true; }
/// change the encoding of the input stream to \p e (iconv name)
- bool setEncoding(std::string const & e);
+ void setEncoding(std::string const & e);
// add to the list of characters to read before actually reading
// the stream