[patch, libgfortran] Wrong result for UTF-8/UCS-4 list-directed and namelist read and nml write

Jerry DeLisle jvdelisle@charter.net
Sun Mar 30 04:58:00 GMT 2014


Hi all,

The attached patch fixes namelist read/write and list directed read/write to
support UTF-8.

I have attached a preliminary test case to use to experiment with this.  I will
need to set it up for the testsuite still.

Regression tested on x86-64-linux-gnu.

OK for trunk or wait?

Regards,

Jerry

2014-03-29  Jerry DeLisle  <jvdelisle@gcc.gnu>

	PR libfortran/52539
	* io/list_read.c: Add uchar typedef. (push_char4): New function
	to save kind=4 character. (next_char_utf8): New function to read
	a single UTF-8 encoded character value. (read_chracter): Update
	to use the new functions for reading UTF-8 strings.
	(list_formatted_read_scalar): Update to handle list directed
	reads of UTF-8 strings. (nml_read_obj): Likewise update for
	UTF-8 strings in namelists.
	* io/write.c (nml_write_obj): Add kind=4 character support for
	namelist writes.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr52539.diff
Type: text/x-patch
Size: 7773 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140330/6a86a885/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr52539.f90
Type: text/x-fortran
Size: 1372 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20140330/6a86a885/attachment-0001.bin>


More information about the Fortran mailing list