]> git.saurik.com Git - wxWidgets.git/commit
Fix wxConvAuto behaviour when it is used by wxTextInputStream.
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 4 Jan 2010 12:22:49 +0000 (12:22 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 4 Jan 2010 12:22:49 +0000 (12:22 +0000)
commit4cb0e8d05cadea6be3a7bd93f1fea9a9e0df95f0
tree02428a6a3300f90ef838f4413d191a7cb8796efa
parent55e5154d2cc5f994c34b128cd05fdc14f2c2fc43
Fix wxConvAuto behaviour when it is used by wxTextInputStream.

wxConvAuto implicitly supposed that the chunk of data passed to it for
translation was big enough to allow it to at least detect the BOM from it.
However this isn't necessarily the case and never is with wxTextInputStream
which reads the bytes one by one.

Fix this by waiting until we have enough data to be able to detect the BOM.
This still doesn't fix the problem with streams without BOM and the
corresponding unit test still fails -- it will need to be fixed at the level
of wxTextInputStream itself later but handling correctly the cases when a BOM
is present is already better than before.

See #11570.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
docs/changes.txt
include/wx/convauto.h
src/common/convauto.cpp
src/common/txtstrm.cpp
tests/mbconv/convautotest.cpp