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
This commit is contained in:
Vadim Zeitlin
2010-01-04 12:22:49 +00:00
parent 55e5154d2c
commit 4cb0e8d05c
5 changed files with 213 additions and 59 deletions

View File

@@ -435,6 +435,7 @@ All:
- wxDateTime timezone functions now dynamic (no caching).
- Added wxHttp::GetCookie and wxHttp::HasCookies (dodge).
- Added support for unique volume names to wxFileName (Neno Ganchev).
- Correct bugs when using wxTextInputStream with wxConvAuto (Leon Buikstra).
Unix: