aboutsummaryrefslogtreecommitdiff
path: root/modules/textadept/editing.lua
diff options
context:
space:
mode:
Diffstat (limited to 'modules/textadept/editing.lua')
-rw-r--r--modules/textadept/editing.lua1
1 files changed, 1 insertions, 0 deletions
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 9235aa70..27af2eca 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -242,6 +242,7 @@ function M.paste()
end
-- Strip leading indentation from clipboard text.
local text = ui.clipboard_text
+ if not buffer.encoding then text = text:iconv('ISO-8859-1', 'UTF-8') end
local lead = text:match('^[ \t]*')
if lead ~= '' then text = text:sub(#lead + 1):gsub('\n'..lead, '\n') end
-- Change indentation to match buffer indentation settings.