From c1a401202735e158aea3f60e2bb46be5c470aac9 Mon Sep 17 00:00:00 2001 From: cch Date: Tue, 29 Mar 2016 14:20:23 +0800 Subject: [PATCH] Convert value to string before escape it Originall ftcsv will be failed when encoding a number field content --- ftcsv.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/ftcsv.lua b/ftcsv.lua index 501b5c1..1e60555 100644 --- a/ftcsv.lua +++ b/ftcsv.lua @@ -323,6 +323,7 @@ end -- a function that delimits " to "", used by the writer local function delimitField(field) + local field = tostring(field) if field:find('"') then return field:gsub('"', '""') else