Skip to content

Commit

Permalink
Update encoding related code
Browse files Browse the repository at this point in the history
  • Loading branch information
deeppandya committed Jul 28, 2020
1 parent df381fa commit 63287d1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import org.chromium.chrome.browser.ntp_background_images.NTPBackgroundImagesBridge;

public class RateFeedbackUtils {
private static final String TAG = "Rate";
private static final String TAG = "Rate_Brave";
private static final String RATE_URL = "https://laptop-updates.brave.com/1/feedback";

public interface RateFeedbackCallback {
Expand Down Expand Up @@ -92,15 +92,15 @@ private static void sendRateFeedback(String userSelection, String userFeedback)
jsonParam.put("api_key", mNTPBackgroundImagesBridge.getReferralApiKey());

OutputStream outputStream = urlConnection.getOutputStream();
byte[] input = jsonParam.toString().getBytes(StandardCharsets.UTF_8.toString());
byte[] input = jsonParam.toString().getBytes(StandardCharsets.UTF_8.name());
outputStream.write(input, 0, input.length);
outputStream.flush();
outputStream.close();

int HttpResult = urlConnection.getResponseCode();
if (HttpResult == HttpURLConnection.HTTP_OK) {
BufferedReader br = new BufferedReader(new InputStreamReader(
urlConnection.getInputStream(), StandardCharsets.UTF_8.toString()));
urlConnection.getInputStream(), StandardCharsets.UTF_8.name()));
String line = null;
while ((line = br.readLine()) != null) {
sb.append(line + "\n");
Expand Down

0 comments on commit 63287d1

Please sign in to comment.