uc(3f) - [M_strings:NONALPHA] uc C-like escape sequences (LICENSE:PD)
Synopsis
Description
Examples
Author
License
function uc(line,escape) result(lineout)
integer, parameter :: u = selected_char_kind(ISO_10646) integer, parameter :: a = selected_char_kind(ASCII) character(len=:,kind=u),allocatable :: lineoutcharacter(len=*,kind=u) :: line character(len=1,kind=u),intent(in),optional :: escape
uc() ucs sequences used to represent commonly used escape sequences or control characters. By default ...
Escape sequences
\ backslash a alert (BEL) -- g is an alias for a b backspace c suppress further output e escape f form feed n new line r carriage return t horizontal tab v vertical tab oNNN byte with octal value NNN (3 digits) dNNN byte with decimal value NNN (3 digits) xHH byte with hexadecimal value HH (2 digits) -- h is an alias for x uHHHH Unicode value The default escape character is the backslash, but this may be changed using the optional parameter ESCAPE.
Sample Program:
program demo_uc ! run in a terminal with Unicode support, like xterm or sakura. use, intrinsic :: iso_fortran_env, only : output_unit use M_strings, only : uc implicit none integer, parameter :: u = selected_char_kind(ISO_10646) character(kind=u, len=:), allocatable :: string open (output_unit, encoding=utf-8) string = uc(u_unicode character: \u263B and \u263b) print (a), string end program demo_uc
John S. Urban
Public Domain
uc (3) | October 17, 2020 |