小编hab*_*bit的帖子

将字符串列表从python/ctypes传递给C函数,期望char**

我有一个C函数,它期望list\0终止的字符串作为输入:

void external_C( int length , const char ** string_list) { 
   // Inspect the content of string_list - but not modify it.
} 
Run Code Online (Sandbox Code Playgroud)

从python(使用ctypes)我想基于python字符串列表调用此函数:

def call_c( string_list ):
    lib.external_C( ?? )

call_c( ["String1" , "String2" , "The last string"])
Run Code Online (Sandbox Code Playgroud)

有关如何在python端构建数据结构的任何提示?注意我保证C函数不会改变string_list中字符串的内容.

问候

乔金 -

c python ctypes

20
推荐指数
3
解决办法
8580
查看次数

UTF-8或UTF-16或UTF-32或UCS-2

我正在设计一个新的CMS,但想设计它以满足我未来的所有需求,如多语言内容,所以我认为Unicode(UTF-8)是最好的解决方案

但通过一些搜索,我得到了这篇文章

http://msdn.microsoft.com/en-us/library/bb330962%28SQL.90%29.aspx#intlftrql2005_topic2

所以我现在很困惑现在使用UTF-8/UTF-16/UTF-32/UCS-2

这对于多语言内容和性能等更好.

PS:我使用的是Asp.net和c#以及SqlServer 2005

提前致谢

c# asp.net unicode

10
推荐指数
2
解决办法
9492
查看次数

标签 统计

asp.net ×1

c ×1

c# ×1

ctypes ×1

python ×1

unicode ×1