fix Lingva encoding issue

markdown
Thomas 1 year ago
parent 958e4f6aa5
commit 870eeeb834

@ -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) {

Loading…
Cancel
Save