diff --git a/backend/internal/handler/user_handler.go b/backend/internal/handler/user_handler.go index db734038..ce1530a9 100644 --- a/backend/internal/handler/user_handler.go +++ b/backend/internal/handler/user_handler.go @@ -615,9 +615,12 @@ func (h *UserHandler) ExportUsersCSV(c *fiber.Ctx) error { } // 3. Set CSV Headers - c.Set("Content-Type", "text/csv") + c.Set("Content-Type", "text/csv; charset=utf-8") c.Set("Content-Disposition", "attachment; filename=users_export_"+time.Now().Format("20060102")+".csv") + // [New] Write UTF-8 BOM for Excel compatibility + _, _ = c.Write([]byte{0xEF, 0xBB, 0xBF}) + writer := csv.NewWriter(c) defer writer.Flush()