Created
May 9, 2016 13:40
-
-
Save mtarnovan/bb8500e81629620335eb9fd438c80a3d to your computer and use it in GitHub Desktop.
This file contains 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
# a mapping from turkish to romanian code points | |
# Ş => Ș etc | |
TURKISH_TO_ROMANIAN = { | |
350 => 536, | |
351 => 537, | |
354 => 538, | |
355 => 539 | |
}.freeze | |
def turkish_to_romanian(string) | |
string.unpack('U*').map! { |x| TURKISH_TO_ROMANIAN[x] || x }.pack('U*') | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment