This code seems to work as a better workaround for the problem. leading_white_space: INTEGER local i, l_count: INTEGER; l_area: like area; c_i: CHARACTER l_prop: like character_properties do l_area := area; l_count := count; l_prop := character_properties from i := 0 until i = l_count loop c_i := l_area [i] -- `Unencoded_character' is space if c_i = Unencoded_character then if l_prop.is_space (unencoded_item (i + 1)) then Result := Result + 1 else i := l_count - 1 -- break out of loop end elseif c_i.is_space then Result := Result + 1 else i := l_count - 1 -- break out of loop end i := i + 1 end ensure substring_agrees: across substring (1, Result) as char all character_properties.is_space (char.item) end end