This smells like a Unicode conversion? Can all the splitting be replaced with Rex::Text::to_ascii()?