fix Lingva encoding issue

This commit is contained in:
Thomas 2023-07-22 15:15:43 +02:00
parent 958e4f6aa5
commit 870eeeb834
1 changed files with 2 additions and 3 deletions

View File

@ -29,7 +29,6 @@ import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import java.net.URLEncoder;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
@ -149,8 +148,8 @@ public class TransAsync {
str_response = new Client().post(MyTransL.getLibreTranslateUrl(), this.timeout, params);
} else if (te == MyTransL.translatorEngine.LINGVA) {
String key = MyTransL.getInstance(te).getLibreTranslateAPIKey();
String contentToSendEncoded = URLEncoder.encode(contentToSend, "UTF-8");
String lingvaURL = MyTransL.getLingvaUrl() + this.params.getSource_lang() + "/" + toLanguage + "/" + contentToSendEncoded;
//String contentToSendEncoded = URLEncoder.encode(contentToSend, "UTF-8");
String lingvaURL = MyTransL.getLingvaUrl() + this.params.getSource_lang() + "/" + toLanguage + "/" + contentToSend;
str_response = new Client().get(lingvaURL, this.timeout);
}
} catch (IOException | NoSuchAlgorithmException | KeyManagementException err) {