Convert string of UCS4 kind to ASCII string.
use penf
character(len=:, kind=ASCII), allocatable :: string
string = str_ascii(UCS4_'I was UCS4 kind, but now I am ASCII')
print "(A)", string
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(kind=UCS4, len=*), | intent(in) | :: | input |
Input string of UCS4 kind. |
Output string of ASCII kind.
pure function str_ascii_ucs4(input) result(output) !< Convert string of UCS4 kind to ASCII string. !< !<```fortran !< use penf !< character(len=:, kind=ASCII), allocatable :: string !< string = str_ascii(UCS4_'I was UCS4 kind, but now I am ASCII') !< print "(A)", string !<``` !=> I was UCS4 kind, but now I am ASCII <<< character(len=*, kind=UCS4), intent(in) :: input !< Input string of UCS4 kind. character(len=:, kind=ASCII), allocatable :: output !< Output string of ASCII kind. output = input endfunction str_ascii_ucs4