Skip to content

Fix invalid UTF-8 and wipe invisible chars, fully compatible with Ruby 1.8 & 1.9 with extensive specs

License

Notifications You must be signed in to change notification settings

JosephHalter/string_cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

string_cleaner

Just add a method .clean to String which does:

  • convert invalid UTF-8 strings from ISO-8859-15 to UTF-8 to fix them

  • recognize euro char from both ISO 8859-15 and Windows-1252

  • replace rn and r with n normalizing end of lines

  • replace control characters and other invisible chars by spaces

Supports only Ruby 2.6+

Install

sudo gem install string_cleaner

Example usage

"\210\004".clean # => " "

Copyright © 2009 Joseph Halter. See LICENSE for details.

About

Fix invalid UTF-8 and wipe invisible chars, fully compatible with Ruby 1.8 & 1.9 with extensive specs

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages