Add proper handling of UTF-8 to grid_reflow().