Skip to content

getBytes encoding should be explicit #105

@davidmoten

Description

@davidmoten

Extending discussion in #95 there are many places in the project source where platform dependent character encoding is used via a call to getBytes() instead of for instance getBytes(utf8) (or whatever is appropriate). All of these calls should use an explicit Charset.

A quick grep showed these:

./src/main/java/com/microsoft/graph/http/DefaultHttpProvider.java:                    bytesToWrite = serializeObject.getBytes();
./src/main/java/com/microsoft/graph/http/DefaultHttpProvider.java:        InputStream in = new ByteArrayInputStream("{}".getBytes());
./src/main/java/com/microsoft/graph/models/extensions/Multipart.java:		addPart(name, contentType, content.getBytes());
./src/main/java/com/microsoft/graph/models/extensions/Multipart.java:		out.write(partContent.getBytes());
./src/main/java/com/microsoft/graph/models/extensions/Multipart.java:		out.write(returnContent.getBytes());
./src/main/java/com/microsoft/graph/models/extensions/Multipart.java:		finalStream.write(addEnding().getBytes());
./src/test/java/com/microsoft/graph/http/MockConnection.java:        return new ByteArrayInputStream(mData.getJsonResponse().getBytes());
./src/test/java/com/microsoft/graph/functional/SharePointTests.java://        String url = "u!" + Base64.getUrlEncoder().encodeToString(testSite.webUrl.getBytes());
./src/test/java/com/microsoft/graph/functional/OneNoteTests.java:        byte[] pageStream = content.getBytes();

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions