title: Wrong encoding of google cloud translate and Java
body: <p>I'm trying to use Google cloud translate. I think the problem is that Google cloud translate use UTF8 and the jvm use UTF16. So i got some typo in translations. For instance : </p>
  
  <pre><code>      public static void main(String... args) throws Exception {
      // Instantiates a client
      Translate translate = TranslateOptions.getDefaultInstance().getService();
  
      // The text to translate
      String text = "Bonjour, à qui dois-je répondre? Non, C'est l'inverse...";
  
      // Translates some text into Russian
      Translation translation =
          translate.translate(
              text,
              TranslateOption.sourceLanguage("fr"),
              TranslateOption.targetLanguage("en"));
  
  
      System.out.printf("Text: %s%n", text);
      System.out.printf("Translation: %s%n", StringEscapeUtils.unescapeHtml(translation.getTranslatedText()));
    }
  </code></pre>
  
  <p>will return : </p>
  
  <p>"Translation: Hello, who should I answer? No, it&amp;#39;s the opposite ..."</p>
  
  <p>instead of :</p>
  
  <p>Translation: Hello, who should I answer? No, it's the opposite ...</p>
  
  <p>We can't change the encoding of a java String, and the Google Cloud Api will not accept anything (Byte[]?) but String. </p>
  
  <p>Do someone know how to fix it? </p>
  
  <p>Thank you for reading</p>
  
  <p>Edit : This code is now working, I added the StringEscapeUtils.unescapeHtml from commons.apache dependencies. I do not know if there is an other way to do it. </p>