How is this website fixing the encoding?

前端 未结 6 1541
情歌与酒
情歌与酒 2021-01-07 11:51

I am trying to turn this text:

×וויר. העתיד של רשתות חברתיות והתקשורת ×©×œ× ×•

Into this text:



        
6条回答
  •  轮回少年
    2021-01-07 12:19

    Based on Oded's and Teddy's answers, I came up with this method, which worked for me:

    public String getProperHebrew(String gibberish){
        byte[] orig = gibberish.getBytes(Charset.forName("windows-1252"));
    
        try {
            return new String(orig, "UTF-8");
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
            return "";
        }
    }
    

提交回复
热议问题