From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26459 invoked by alias); 3 Mar 2015 16:39:34 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 26180 invoked by uid 48); 3 Mar 2015 16:39:31 -0000 From: "zbeekman at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/65144] Problems printing, reading and accessing substrings of ISO_10646 character variables Date: Tue, 03 Mar 2015 16:39:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: fortran X-Bugzilla-Version: 4.9.2 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: zbeekman at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-03/txt/msg00342.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65144 --- Comment #2 from Zaak --- Try this: program test3 INTEGER,PARAMETER :: ucs4 = selected_char_kind("ISO_10646") CHARACTER(3,UCS4),PARAMETER :: unip=CHAR(INT(Z'5e74'),UCS4)//CHAR(INT(Z'6708'),ucs4)//CHAR(INT(Z'65e5'),ucs4) character(3,UCS4) :: uni uni = unip open(6, encoding="utf-8") print *, uni print *, uni(2:2) print *, unip print *, "'",unip(1:1),"'" call write_it(unip(2:2)) contains subroutine write_it(str) character(len=*,kind=UCS4) ,intent(in) :: str print *, str end subroutine write_it end program test3 I get this error message when I try to compile: $ gfortran test3.f90 test3.f90:11.16: call write_it(unip(2:2)) 1 Error: Type mismatch in argument 'str' at (1); passed CHARACTER(1) to CHARACTER(4)