From 93b9cc6a652a4844d3cf3ed68d3a27fbad90dd21 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