/
niceSOFT
/
swig
Обзор
Документация
Войти
/
niceSOFT
/
swig
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Examples/test-suite/python_strict_unicode.i
41 строка
559 B
Alec Cooper
Tests for Python Bytes/Unicode distinction
05 фев 2016, 05:07
05 фев 2016, 05:07
17a4143
Код
Авторство
О чём код?
%module python_strict_unicode %include <std_string.i> %include <std_wstring.i> %begin %{ #define SWIG_PYTHON_STRICT_BYTE_CHAR #define SWIG_PYTHON_STRICT_UNICODE_WCHAR %} %inline %{ std::string double_str(const std::string& in) { return in + in; } char *same_str(char* in) { return in; } std::wstring double_wstr(const std::wstring& in) { return in + in; } wchar_t *same_wstr(wchar_t* in) { return in; } std::wstring overload(const std::wstring& in) { return L"UNICODE"; } std::string overload(const std::string& in) { return "BYTES"; } %}