summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-18 18:05:58 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2010-08-18 18:05:58 +0000
commit8a1f3aac67ac00e3304a8da687ac2afa7f8c8a35 (patch)
tree4c1ac5d8652f4fc42c8d09951562f6736a634591
parentd7b0d4e703fe17905d497fd455a85ba2520e774e (diff)
downloadgcc-8a1f3aac67ac00e3304a8da687ac2afa7f8c8a35.tar.gz
2010-08-18 Tobias Burnus <burnus@net-b.de>
PR fortran/45295 * intrinsic.texi (selected_char_kind): Document ISO_10646 support. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163347 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/fortran/ChangeLog6
-rw-r--r--gcc/fortran/intrinsic.texi27
2 files changed, 26 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 67bcf5ab80c..3adaabc2ead 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,9 @@
+2010-08-18 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/45295
+ * intrinsic.texi (selected_char_kind): Document ISO_10646
+ support.
+
2010-08-17 Jakub Jelinek <jakub@redhat.com>
PR fortran/45304
diff --git a/gcc/fortran/intrinsic.texi b/gcc/fortran/intrinsic.texi
index fecafbdcf81..566050062a1 100644
--- a/gcc/fortran/intrinsic.texi
+++ b/gcc/fortran/intrinsic.texi
@@ -9677,7 +9677,8 @@ seconds.
@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 @@ Transformational function
@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')
+
+ 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
- s = ascii_"abcdefghijklmnopqrstuvwxyz"
- print *, s
-end program ascii_kind
+ open (output_unit, encoding='UTF-8')
+ write (*,*) trim (hello_world)
+end program character_kind
@end smallexample
@end table