https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66499
Dominique d'Humieres <dominiq at lps dot ens.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Last reconfirmed| |2015-06-11 Ever confirmed|0 |1 --- Comment #1 from Dominique d'Humieres <dominiq at lps dot ens.fr> --- Confirmed from 4.8.4 up to trunk (6.0). If I add the lines print *, len(trim(char1)) print *, len(trim(char2)) I get 23 25 So each à counts as two characters, while it is printed as only one. This make me wonder if the code is valid. However the following variant program test_character real:: a character(len=30, kind=4):: char1, char2 a = 10 char1 = 4_"Test without local char" char2 = 4_"Test with local char ÃÃ" 10 format(2X, A, T40, f10.4) open(6, encoding="utf-8") print *, len(trim(char1)) print *, len(trim(char2)) write(*,10) char1, a write(*,10) char2, a end program gives 23 25 Test without local char 10.0000 Test with local char Ãà 10.0000 ???