Message210064
The PyInit_NAME symbol is not the only place where NAME is used. The NAME is also present in the PyModuleDef structure. It looks lie Python expects UTF-8 here. You encode it to UTF-8 and use "\xHH\xHH\xHH..." syntax to keep ASCII encoding for the C file? The NAME may also be mentionned in docstrings, C comments, type names, etc.
I don't like the idea of a new encoding just for one very specific function in C. There are already too many encodings in the world :-( The C language supports non-ASCII identifiers, but I don't know how they are encoded in the symbol table. I would prefer to rely on the C compiler if you would like to play in the playground of non-ASCII identifiers.
In Python/dynload_win.c, _PyImport_GetDynLoadWindows() uses GetProcAddressA().
Is it a theorical feature request, or you really have a Python module with a non-ASCII name?
I'm not sure that it's really useful to support non-ASCII module names for C modules, even if I spend many months to support non-ASCII module names for Python modules :-) |
|
Date |
User |
Action |
Args |
2014-02-03 00:59:26 | vstinner | set | recipients:
+ vstinner, brett.cannon, amaury.forgeotdarc, ncoghlan, Suzumizaki, eric.snow, serhiy.storchaka |
2014-02-03 00:59:26 | vstinner | set | messageid: <1391389166.68.0.258228341713.issue20485@psf.upfronthosting.co.za> |
2014-02-03 00:59:26 | vstinner | link | issue20485 messages |
2014-02-03 00:59:26 | vstinner | create | |
|