Fix HTML copy lengths with UTF8 encoding