JSON/test_iso_10646_support [ Unittest ]

[ Top ] [ Unittest ]

NAME

test_iso_10646_support

DESCRIPTION

This program is run when configuring the json-fortran build, to determine whether or not ISO 10646/UCS4 characters are supported by the compiler.

AUTHOR

Izaak Beekman

SOURCE

17     program test_iso_10646_support
18 
19     use iso_fortran_env ,only: output_unit, error_unit
20 
21     implicit none
22 
23     integer, parameter :: UCS4_K = selected_char_kind('ISO_10646')
24 
25     if ( UCS4_K == -1 ) then !Not supported!
26         write(error_unit,'(A)') 'Your compiler does not support ISO 10646/UCS4 characters!'
27         write(error_unit,'(A)') 'JSON-Fortran must/will be configured to use the "DEFAULT"'
28         write(error_unit,'(A)') 'character set. (Should be "ASCII" on a reasonable system.)'
29         stop 2
30     else
31         write(error_unit,'(A)') 'Congratulations! Your compiler supports ISO 10646/UCS4!'
32         write(error_unit,'(A)') 'JSON-Fortran may be configured to enable UCS4 support.'
33         write(output_unit,'(A)') 'UCS4_SUPPORTED'
34     end if
35 
36     end program test_iso_10646_support