daily pastebin goal
19%
SHARE
TWEET

Untitled

a guest Jan 13th, 2019 9 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import sys
  2. script, input_encoding, error = sys.argv
  3.  
  4. def main(language_file, encoding, errors):
  5.     line = language_file.readline()
  6.    
  7.     if line:
  8.         print_line(line, encoding, errors)
  9.         return main(language_file, encoding, errors)
  10.        
  11. def print_line(line, encoding, errors):
  12.     next_lang = line.strip()
  13.     raw_bytes = next_lang.encode(encoding, errors=errors)
  14.     cooked_string = raw_bytes.decode(encoding, errors=errors)
  15.    
  16.     print(raw_bytes, "<===>", cooked_string)
  17.    
  18. language = open("languages.txt", encoding="utf-8")
  19.  
  20. main(language, input_encoding, error)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top