Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
myon-bioinformatics committed Jun 24, 2023
1 parent fbd27c9 commit 7d6bd1a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
def standard_output_harmless_shift_jis():
easy_separator = easy_separator_closure()()
for char in ["る","た","記","〆","能.","a","1"]: #harmless
print(char,char.encode("shift_jis"))
print(char,char.encode("shift_jis"),sep=": ")
easy_separator
return

#Standard Output: HARMFUL Shift_JIS char!!
def standard_output_harmful_shift_jis():
easy_separator = easy_separator_closure()()
for char in ["表","能","十","法","充","型","施","倍","本","図"]: #HARMFUL!!!!
print(char,char.encode("shift_jis"))
print(char,char.encode("shift_jis"),sep=": ")
easy_separator
return

Expand Down Expand Up @@ -45,7 +45,7 @@ def print_function_name():
standard_output_harmless_shift_jis()
standard_output_harmful_shift_jis()

#print("No problem!!") with Shift_JIS char comments
#print("No problem!!") with Shift_JIS char
print_harmless_shift_jis()
print_harmful_shift_jis()

Expand Down
24 changes: 12 additions & 12 deletions main_to_mojibake.py
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
'''Dear English speaker
!!!!!Attention in advance: this program is a failed case!!!!!
SyntaxError: Non-UTF-8 code starting with...this is encoded to "Shift JIS intentionally.
SyntaxError: Non-UTF-8 code starting with...��this is encoded to "Shift JIS�h intentionally.
Python 3 uses "UTF-8" as default encoding. you should execute main.py instead of this
'''

'''日本語話者に向けて
!!!!!予め: このプログラムは失敗事例です!!!!!
SyntaxError: Non-UTF-8 code starting with...←わざとこのファイルを"Shift JIS"にエンコードしています。
Python3はデフォルトのエンコーディングとして「UTF-8」を使います。これではなくmain.pyを素直に実行してください。。
'''���{��b�҂Ɍ�����
!!!!!�\��: ���̃v���O�����͎��s����ł�!!!!!
SyntaxError: Non-UTF-8 code starting with...���킴�Ƃ��̃t�@�C����"Shift JIS"�ɃG���R�[�h���Ă��܂��B
Python3�̓f�t�H���g�̃G���R�[�f�B���O�Ƃ��āuUTF-8�v���g���܂��B����ł͂Ȃ�main.py��f���Ɏ��s���Ă��������B�B
'''

import inspect

#Standard Output: harmless Shift_JIS char
def standard_output_harmless_shift_jis():
easy_separator = easy_separator_closure()()
for char in ["?","?","?","?","閭ス.","a","1"]: #harmless
print(char,char.encode("shift_jis"))
for char in ["?","?","?","?",".","a","1"]: #harmless
print(char,char.encode("shift_jis"),sep=": ")
easy_separator
return

#Standard Output: HARMFUL Shift_JIS char!!
def standard_output_harmful_shift_jis():
easy_separator = easy_separator_closure()()
for char in ["陦ィ","閭ス","?","?","?","?","譁ス","?","譛ャ","蝗ウ"]: #HARMFUL!!!!
print(char,char.encode("shift_jis"))
for char in ["","","?","?","?","?","","?","",""]: #HARMFUL!!!!
print(char,char.encode("shift_jis"),sep=": ")
easy_separator
return

#print("No problem!!") with harmless Shift_JIS char
def print_harmless_shift_jis():
easy_separator = easy_separator_closure()() #繧ッ繝ュ繝シ繧ク繝」繧剃スソ逕ィ縺励◆
easy_separator = easy_separator_closure()() #クロージャを使用した
print("No problem!!")
easy_separator
return

#print("No problem!!") may not function with HARMFUL Shift_JIS char!!
def print_harmful_shift_jis():
easy_separator = easy_separator_closure()() #縺薙l縺ッ繧ッ繝ュ繝シ繧ク繝」縺ィ縺?縺?讖溯?ス
easy_separator = easy_separator_closure()() #これはクロージャと�?�?機�?�
print("No problem!!")
easy_separator
return
Expand All @@ -56,7 +56,7 @@ def print_function_name():
standard_output_harmless_shift_jis()
standard_output_harmful_shift_jis()

#print("No problem!!") with Shift_JIS char comments
#print("No problem!!") with Shift_JIS char
print_harmless_shift_jis()
print_harmful_shift_jis()

Expand Down

0 comments on commit 7d6bd1a

Please sign in to comment.