tweak line<->char conversion