API: fix clipboard paste for utf-8