Created
August 31, 2012 16:19
-
-
Save sycobuny/3555317 to your computer and use it in GitHub Desktop.
Convert my unicode diagrams to ASCII
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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