This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/66499] Letters with accents change format behavior for X and T descriptors.
- From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 19 May 2017 03:23:24 +0000
- Subject: [Bug fortran/66499] Letters with accents change format behavior for X and T descriptors.
- Auto-submitted: auto-generated
- References: <bug-66499-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66499
--- Comment #3 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
The trimmed length is incorrect.
With this test:
program test_character
real:: a
character(len=2, kind=4):: char1, char2
char2 = 4_"Ã"
open(6, encoding="utf-8")
write(*,'(a)') trim(char2)
!print *, len(trim(char2),4)
end program
The length computed for len(trim(char2),4) is 2.
$ ./a.out >test.out
[jerry@amda8 pr66499]$ xxd test.out
00000000: c383 c283 0a
We have an extra word being emitted. Two extra bytes.