2

I parse site and get String in windows-1251 encoding. I want print it to console for example. But in console I see incomprehensible symbols. How I can convert windows-1251 String to UTF-8 or how I can print normal string using kotlin-js ?

Artem Viter
  • 804
  • 7
  • 12
  • 2
    A String object is *already/always* in Unicode. What is used to populate the string? Conversion from/to different *encodings* should be handled on ingestion (as a String is created from a sequence of bytes) and output (as a String is written as a sequence of bytes) .. – user2864740 Dec 26 '17 at 23:31
  • I used html parser and parser returned string in unreadable format. Is your proposal convert String to byte array , then decode it and convert to String back ? – Artem Viter Nov 20 '19 at 16:23
  • No. The first step is to find out why the parser returned the string in an “unreadable format.” – user2864740 Nov 20 '19 at 19:24

0 Answers0