Skip to content

Commit 34464bb

Browse files
Issue with sending non ANCII chars. They was encoded wrongly.
"носок" -> "=>A>:". Issue of rest client outstream "posteroutputstream" Solved by getting string as byte[] with proper encoding
1 parent e582aac commit 34464bb

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

libs/sparkpost-lib/src/main/java/com/sparkpost/transport/RestConnection.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,7 @@ private void sendData(HttpURLConnection conn, String data) throws SparkPostExcep
184184
// Send data. At this point connection to server may not be established,
185185
// but writing data to it will trigger the connection.
186186
try (DataOutputStream wr = new DataOutputStream(conn.getOutputStream())) {
187-
188-
wr.writeBytes(data);
187+
wr.write(data.getBytes(DEFAULT_CHARSET));
189188
wr.flush();
190189
} catch (IOException ex) {
191190
throw new SparkPostException("Error sending request data:" + ex.toString());

0 commit comments

Comments
 (0)