这是我的代码:
# -*- coding: utf-8-*-
array=["à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ"]
array1=["א","ב","ג","ד","ה","ו","ז","ח","ט","י","ך","כ","ל","ם","מ","ן","נ","ס","ע","ף","פ","ץ","צ","ק","ר","ש","ת"]
str="áï éäåãä"
message=""
for i in range(0,len(str)):
s=str[i]
index=-1
for j in range(0,len(array)):
if(array[j]==s):
index=j
break
if(index!=-1):
message+=array1[index]
print array1[index]
print message
错误是:
SyntaxError: EOL while scanning string literal
在第 2 行
我有一个希伯来语文本文件,但无论编码是什么,它总是以乱码显示。这是一个将其转换为希伯来语的 python 程序。原始文件在 IS0-8859-1