Returned files default encoding #306

Closed
opened 2025-12-29 15:20:18 +01:00 by adam · 0 comments
Owner

Originally created by @tomatualus on GitHub (Oct 16, 2020).

Hello.

I am wondering, if there is a default encoding when using BodyAsFile?

"Response": { "StatusCode": 200, "Headers": { "Content-Type": "text/xml; charset=UTF-8" }, "BodyAsFile": "./WireMockMappings/TestResponse.xml", "UseTransformer": false }

I have set up my response exactly as above, but the returned file's encoding is UTF-16 (i can see the BOM or whatever at the start).

image
Also here you can see that the files encoding us UTF-8.

Originally created by @tomatualus on GitHub (Oct 16, 2020). Hello. I am wondering, if there is a default encoding when using BodyAsFile? ` "Response": { "StatusCode": 200, "Headers": { "Content-Type": "text/xml; charset=UTF-8" }, "BodyAsFile": "./WireMockMappings/TestResponse.xml", "UseTransformer": false }` I have set up my response exactly as above, but the returned file's encoding is UTF-16 (i can see the BOM or whatever at the start). ![image](https://user-images.githubusercontent.com/8881849/96262201-26945d80-0fca-11eb-8b68-7c104ecc190b.png) Also here you can see that the files encoding us UTF-8.
adam added the question label 2025-12-29 15:20:18 +01:00
adam closed this issue 2025-12-29 15:20:18 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net-wiremock#306