def to_utf8(n): # hier die UTF8-Byte-Sequenz als String generieren def header(): return '' def footer(): return '' def shownice(code, title=""): utf8 = to_utf8(code); res = utf8+"     "+ title+" Unicode "+str(code)+" = "+hex(code)+ " = "+bin(code)+"   UTF8-Codierung: " for i in range(len(utf8)): res += str(ord(utf8[i])) + " " res += " hex: " for i in range(len(utf8)): res += hex(ord(utf8[i])) + " " res += " binary: " for i in range(len(utf8)): res += bin(ord(utf8[i])) + " " return res out = open("uft8test.html","w") out.write(header()) out.write(shownice(0x260e,"Telefon")) out.write(footer()) out.close()