#!/usr/bin/env python3
# -*- coding : utf-8 -*-

# Multi-Lang
print("我爱你")
# Get the encoded int for some data
ord('A')
ord('我')
# decode from int to data
chr(66)
chr(25991)

# Use Hex to show some data
'\u4e2d\u6587'
# Encode or decode from string to bytes via ascii or utf-8
# a string is using a few bytes , but a byte is just a byte.
# As we all know, Chinese data cannot be showed in ascii


'我'.encode('utf-8')
# Error:  '我'.encode(ascii)

'ABC'.encode('ascii')
b'ABC'.decode('ascii')
b'\xe4\xb8\xad\xe6\x96\x87'.decode('utf-8')

# Calculate data length
len('aBC')
len('我')
len(b'ABC')
len(b'\xe4\xb8\xad\xe6\x96\x87')

# Use the text in line1 to tell interpreter that using utf-8 encoding.