trim_invalid_utf8_byte Function

public pure function trim_invalid_utf8_byte(chara) result(res)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: chara

Return Value character(len=:), allocatable


Source Code

   pure function trim_invalid_utf8_byte(chara) result(res)
      implicit none
      character(*), intent(in) :: chara
      character(:), allocatable :: res
      
      if (is_valid_multiple_byte_character(chara)) then
         res = chara
      else
         res = ''
      end if
   
   end function trim_invalid_utf8_byte