Intro to Coding - Encode and Decode Text
Code for the encode decode unicode assignment:
# Encoding and Decoding Text Strings in Unicode stringEnglish = "Hello, world!" stringGerman = "Äpfel" stringFrench = "fenêtre" print(stringEnglish) unicode1 = stringEnglish.encode(encoding='utf-8', errors='strict') print("The string 'Hello, world!' looks like this in Unicode:\n", unicode1) unicode2 = stringGerman.encode(encoding='utf-8', errors='strict') print("The German word for 'apple' looks like this in Unicode:\n", unicode2) unicode3 = stringFrench.encode(encoding='utf-8', errors='strict') print("The French word for 'window' looks like this in Unicode:\n", unicode3) string1 = unicode1.decode(encoding='utf-8', errors='strict') print("Decoding the first Unicode string to text:\n", string1) string2 = unicode2.decode(encoding='utf-8', errors='strict') print(string2, "is how you spell 'apple' in German.") string3 = unicode3.decode(encoding='utf-8', errors='strict') print("And", string3, "is how you spell 'window' in French.")
Select the correct answer. 1. What is character encoding? a system in computer programming that pairs a character in a language set with a sequence of binary digits a system in programming that encodes hidden commands in game applications a system in computer programming that changes text characters into pixel patterns a system in programming that translates one programming language into another
1. a system in computer programming that pairs a character in a language set with a sequence of binary digits
Complete each sentence by using the drop-down menus. 1. In the 1980s, different encoding systems from computer makers led to ? 2. In response to the problems with different encoding systems, developers ?
1. encoding errors when exchanging data between machines 2. unified the various encoding systems into one universal character set
2. What does ASCII stand for? American Standard Code for Information Interlocution American Standard Code for Information Interchange American Standard Code for Intelligent Information Armenian Standard Code for International Intercommunication
2. American Standard Code for Information Interchange