Py学习  »  Python

使用Python2.7读取微芯片中的罗马字符

Bill • 5 年前 • 647 次点击  

我使用Windows7和Python2.7。

我写了一个GUI程序来读取和显示微芯片上的一些名字,它对所有名字都很有效,除了一些罗马字符,比如‘I’。

这是从微芯片读取名称的功能:

def read_config_info(self, info):
    MAX_LEN = 256
    item_info = c_char_p(info)
    read_value_buffer= create_string_buffer(MAX_LEN)
    max_len = c_uint32(MAX_LEN)
    p_max_len = pointer(max_len)

    status = self._engine_dll.teConfigCacheReadItem(self.dev_handle, 
    item_info, byref(read_value_buffer), p_max_len)
    AssertSuccess(status, 'Read %s failed' % info)
    return read_value_buffer.value

......

  name = self.read_config_info(name_info)

当我试图读取一个罗马字符“I”时,它显示了一个奇怪的字符(GUI界面中“a”头上的一个点)。

如何对其进行编码,以便在GUI界面中显示罗马字符“I”?

Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/51594
 
647 次点击