From patchwork Wed Aug 18 18:07:02 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tobias Burnus X-Patchwork-Id: 62074 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 752B5B70A7 for ; Thu, 19 Aug 2010 04:07:15 +1000 (EST) Received: (qmail 19667 invoked by alias); 18 Aug 2010 18:07:13 -0000 Received: (qmail 19649 invoked by uid 22791); 18 Aug 2010 18:07:12 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mx01.qsc.de (HELO mx01.qsc.de) (213.148.129.14) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 Aug 2010 18:07:06 +0000 Received: from [192.168.178.22] (port-92-204-42-5.dynamic.qsc.de [92.204.42.5]) by mx01.qsc.de (Postfix) with ESMTP id EDCBC3D210; Wed, 18 Aug 2010 20:07:02 +0200 (CEST) Message-ID: <4C6C2146.70107@net-b.de> Date: Wed, 18 Aug 2010 20:07:02 +0200 From: Tobias Burnus User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; de; rv:1.9.2.7) Gecko/20100714 SUSE/3.1.1 Thunderbird/3.1.1 MIME-Version: 1.0 To: gcc patches , gfortran Subject: [Patch, Fortran, committed] PR45295 - intrinsic.texi: SELECTED_CHAR_KIND should mention wide-char support Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Committed as obvious (Rev. 163347). Tobias Index: gcc/fortran/ChangeLog =================================================================== --- gcc/fortran/ChangeLog (Revision 163346) +++ gcc/fortran/ChangeLog (Arbeitskopie) @@ -1,3 +1,9 @@ +2010-08-18 Tobias Burnus + + PR fortran/45295 + * intrinsic.texi (selected_char_kind): Document ISO_10646 + support. + 2010-08-17 Jakub Jelinek PR fortran/45304 Index: gcc/fortran/intrinsic.texi =================================================================== --- gcc/fortran/intrinsic.texi (Revision 163346) +++ gcc/fortran/intrinsic.texi (Arbeitskopie) @@ -9677,7 +9677,8 @@ @code{SELECTED_CHAR_KIND(NAME)} returns the kind value for the character set named @var{NAME}, if a character set with such a name is supported, or @math{-1} otherwise. Currently, supported character sets include -``ASCII'' and ``DEFAULT'', which are equivalent. +``ASCII'' and ``DEFAULT'', which are equivalent, and ``ISO_10646'' +(Universal Character Set, UCS-4) which is commonly known as Unicode. @item @emph{Standard}: Fortran 2003 and later @@ -9695,13 +9696,25 @@ @item @emph{Example}: @smallexample -program ascii_kind - integer,parameter :: ascii = selected_char_kind("ascii") - character(kind=ascii, len=26) :: s +program character_kind + use iso_fortran_env + implicit none + integer, parameter :: ascii = selected_char_kind ("ascii") + integer, parameter :: ucs4 = selected_char_kind ('ISO_10646') - s = ascii_"abcdefghijklmnopqrstuvwxyz" - print *, s -end program ascii_kind + character(kind=ascii, len=26) :: alphabet + character(kind=ucs4, len=30) :: hello_world + + alphabet = ascii_"abcdefghijklmnopqrstuvwxyz" + hello_world = ucs4_'Hello World and Ni Hao -- ' & + // char (int (z'4F60'), ucs4) & + // char (int (z'597D'), ucs4) + + write (*,*) alphabet + + open (output_unit, encoding='UTF-8') + write (*,*) trim (hello_world) +end program character_kind @end smallexample @end table