Created
September 2, 2017 13:14
-
-
Save kshitij10496/e6ce35c04533b340658004399953199b to your computer and use it in GitHub Desktop.
Python Source Code File Encoding
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
# coding: utf-8 | |
from __future__ import print_function | |
original_string = 'abc∂´ƒ©' | |
unicode_literal = u'abc∂´ƒ©' | |
unicode_string = 'abc∂´ƒ©'.decode('utf-8') | |
print('Original String =', original_string) | |
print('Type =', type(original_string)) | |
print('Representation =', repr(original_string)) | |
print('----------') | |
print('Unicode Literal =', unicode_literal) | |
print('Type =', type(unicode_literal)) | |
print('Representation =', repr(unicode_literal)) | |
print('----------') | |
print('Unicode String =', unicode_string) | |
print('Type =', type(unicode_string)) | |
print('Representation =', repr(unicode_string)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment