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