Here are my changes which seem to resolve the issues in both 'left_adjust' and 'right_adjust' when it comes to adjusting the length and properly repositioning the null character '%U' left_adjust -- Remove leading whitespace. local nb, nb_space: INTEGER l_area: like area l_prop: like character_properties do l_prop := character_properties -- Compute number of spaces at the left of current string. from nb := count - 1 l_area := area until nb_space > nb or else not l_prop.is_space (l_area.item (nb_space)) loop nb_space := nb_space + 1 end if nb_space > 0 then -- Set new count value. nb := nb + 1 - nb_space -- Shift characters to the left. l_area.overlapping_move (nb_space, 0, nb + 1) l_area.remove_tail (nb_space) -- Set new count. count := nb reset_hash_codes end end right_adjust -- Remove trailing whitespace. local i, nb: INTEGER nb_space: INTEGER l_area: like area c: CHARACTER_32 l_prop: like character_properties do l_prop := character_properties -- Compute number of spaces at the right of current string. from nb := count - 1 i := nb l_area := area until i < 0 loop c := l_area.item (i) if not l_prop.is_space (c) then -- We are done. i := -1 else nb_space := nb_space + 1 i := i - 1 end end if nb_space > 0 then -- Shift characters to the left. l_area.overlapping_move (count, count - nb_space, 1) l_area.remove_tail (nb_space) -- Set new count. count := nb + 1 - nb_space reset_hash_codes end end