[PATCH] Handle variable-width encodings in seekoff

Pétur Runólfsson peturr02@ru.is
Tue Sep 9 08:34:00 GMT 2003


Hi,

This patch makes basic_filebuf::seekoff usable with variable-width
encodings. Note that the return value can't be passed to seekpos (yet),
but seekoff can be used to switch between read and write mode.

Tested on i686-pc-linux-gnu.

Petur

2003-09-09  Petur Runolfsson  <peturr02@ru.is>

	* include/bits/fstream.tcc (basic_filebuf::seekoff):
	Use codecvt::length to handle variable-width stateless encodings
	correctly.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/1.cc: New test.
	* testsuite/27_io/basic_filebuf/seekoff/wchar_t/2.cc: New test.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: utf8-seekoff.diff
Type: application/octet-stream
Size: 11159 bytes
Desc: utf8-seekoff.diff
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20030909/8238e531/attachment.obj>


More information about the Libstdc++ mailing list