Skip to content

Commit 6aaffbc

Browse files
jcesarmobilemalo-malomalo-hw
authored
fix(android): UTF-8 encode form data value (#7531)
Co-authored-by: Malo <55086681+malo-malo@users.noreply.github.com> Co-authored-by: Malo <malo.c@hellowatt.fr>
1 parent 7cdb7c7 commit 6aaffbc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

android/capacitor/src/main/java/com/getcapacitor/plugin/util/CapacitorHttpUrlConnection.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ private void writeFormDataRequestBody(String contentType, JSArray entries) throw
275275
if (type.equals("string")) {
276276
os.writeBytes(twoHyphens + boundary + lineEnd);
277277
os.writeBytes("Content-Disposition: form-data; name=\"" + key + "\"" + lineEnd + lineEnd);
278-
os.writeBytes(value);
278+
os.write(value.getBytes(StandardCharsets.UTF_8));
279279
os.writeBytes(lineEnd);
280280
} else if (type.equals("base64File")) {
281281
String fileName = entry.getString("fileName");

0 commit comments

Comments
 (0)