From a0b2d5ba9c5dfea30d1d59294a9f82a3e7c6fc1e Mon Sep 17 00:00:00 2001 From: Fransolet Thomas Date: Fri, 10 Feb 2023 17:33:59 +0100 Subject: [PATCH] Update encoding + add from query language --- ManagerService/Controllers/ConfigurationController.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ManagerService/Controllers/ConfigurationController.cs b/ManagerService/Controllers/ConfigurationController.cs index 3d77150..a761d52 100644 --- a/ManagerService/Controllers/ConfigurationController.cs +++ b/ManagerService/Controllers/ConfigurationController.cs @@ -260,13 +260,14 @@ namespace ManagerService.Controllers /// Export a configuration /// /// Id of configuration to export + /// Language to export [AllowAnonymous] [ProducesResponseType(typeof(FileContentResult), 200)] [ProducesResponseType(typeof(string), 400)] [ProducesResponseType(typeof(string), 404)] [ProducesResponseType(typeof(string), 500)] [HttpGet("{id}/export")] - public FileContentResult Export(string id, string language) + public FileContentResult Export(string id, [FromQuery] string language) { try { @@ -387,7 +388,7 @@ namespace ManagerService.Controllers string jsonString = JsonConvert.SerializeObject(toDownload); var fileName = $"{configuration.Label}.json"; var mimeType = "application/json"; - var fileBytes = Encoding.ASCII.GetBytes(jsonString); + var fileBytes = Encoding.UTF8.GetBytes(jsonString); return new FileContentResult(fileBytes, mimeType) { FileDownloadName = fileName