summaryrefslogtreecommitdiff
path: root/lib/csv.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csv.rb')
-rw-r--r--lib/csv.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/csv.rb b/lib/csv.rb
index 30e4b23586..336b42a697 100644
--- a/lib/csv.rb
+++ b/lib/csv.rb
@@ -1014,8 +1014,8 @@ class CSV
HeaderConverters = {
downcase: lambda { |h| h.encode(ConverterEncoding).downcase },
symbol: lambda { |h|
- h.encode(ConverterEncoding).downcase.strip.gsub(/\s+/, "_").
- gsub(/\W+/, "").to_sym
+ h.encode(ConverterEncoding).downcase.gsub(/[^[\s\w]]+/, "").strip.
+ gsub(/\s+/, "_").to_sym
}
}