I have a strange problem where we have some French names with acute accents which are inserting into the DB as ?.
Example names
Renée
Andrée
Désirée
Aimée
The DB gets populated with the values retrieved from the import CSV step and they show like this;
Ren?e
Andr?e
Désir?e
Aim?e
I though it was a DB issue, and possible still is, however, I can edit the name via our Wappler built backend and its updates the name correctly into the DB.
So it only seems to be when we are importing the names which have been read from the import CSV step. I am using ASP.NET and I am running Version: 7.3.8
If anyone has any ideas or has come across the same issue, I would be grateful for any help.
Normally, using NodeJS, I would use Wappler's file system to read the file and write (save) the file. Wappler uses NodeJS under the hood and writes files as UTF-8 by default - without BOM (Byte Order Mark)
Unfortunately, this will not work for your ASP.NET project.
I am now going to ask Copilot to help me out - I am no ASP.NET expert - to save the file with UTF-8
Final Setup: Wappler ASP.NET Module to Resave CSV as UTF-8 Without BOM
1. Create the Module File
Create a new file in dmxConnect/api/modules/ called resave_csv_utf8.cshtml.
2. Paste This Code
@{
Response.ContentType = "application/json";
try {
// Get query parameters
var inputParam = Request.QueryString["input"];
var outputParam = Request.QueryString["output"];
if (string.IsNullOrEmpty(inputParam) || string.IsNullOrEmpty(outputParam)) {
Response.Write("{\"status\":\"error\",\"message\":\"Missing input or output path.\"}");
Response.End();
}
// Resolve full paths
var inputPath = Server.MapPath("~/" + inputParam);
var outputPath = Server.MapPath("~/" + outputParam);
// Read original file
string content = System.IO.File.ReadAllText(inputPath, System.Text.Encoding.Default);
// Save as UTF-8 without BOM
var utf8WithoutBom = new System.Text.UTF8Encoding(false);
System.IO.File.WriteAllText(outputPath, content, utf8WithoutBom);
// Success response
Response.Write("{\"status\":\"success\",\"message\":\"File resaved as UTF-8 without BOM.\"}");
} catch (Exception ex) {
// Error response
Response.Write("{\"status\":\"error\",\"message\":\"" + ex.Message.Replace("\"", "'") + "\"}");
}
Response.End();
}
3. Call It from Server Connect
Create a Server Action (e.g., resave_csv_action).
Add an API Action step.
Set the URL to: /api/modules/resave_csv_utf8.cshtml?input=uploads/original.csv&output=uploads/resaved_utf8.csv
You can make input and output dynamic by binding them to form inputs or query parameters.
4. Test and Confirm
Run the Server Action.
Check the resaved_utf8.csv file in your uploads folder.
Open it in Wappler to confirm it’s UTF-8 without BOM.
@ben I think I will still look at your option as my client has very little computer knowledge and it would be better to have a module built to handle this.