Skip to content

Instantly share code, notes, and snippets.

@sycobuny
Created August 31, 2012 16:19
Show Gist options
  • Save sycobuny/3555317 to your computer and use it in GitHub Desktop.
Save sycobuny/3555317 to your computer and use it in GitHub Desktop.
Convert my unicode diagrams to ASCII
#!/usr/bin/env ruby
# encoding: utf-8
# etc. etc. etc.........
unless request.user_agent =~ /AppleWebKit/
# sub out all diagram corners with ascii +
%w(┌ ┐ └ ┘).each do |corner|
data.gsub!(corner, '+')
end
data.gsub!('─', '-') # box horizontal line with dash
data.gsub!('│', '|') # box vertical line with pipe
data.gsub!('∧', '^') # mathematical logical-OR with carat
data.gsub!('∨', 'v') # mathematical logical-AND with letter "v"
data.gsub!('═', '=') # box double vertical line with equals
end
# etc. etc. etc........
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment