function win2utf(text){ let buffer = new TextEncoder().encode(text); let decoder = new TextDecoder('windows-1251'); return decoder.decode(buffer); }