Explain modperl that ZNC uses UTF-8 internally

Thanks to jiggawattz for showing the issue
This commit is contained in:
Alexey Sokolov
2016-05-01 23:59:11 +01:00
parent eab62b46e7
commit 2fd14d4fb9
3 changed files with 18 additions and 1 deletions
+1
View File
@@ -48,6 +48,7 @@ if(SWIG_FOUND)
"-I${PROJECT_BINARY_DIR}/include"
"-I${PROJECT_SOURCE_DIR}/include"
"-I${CMAKE_CURRENT_SOURCE_DIR}/.."
"-I${CMAKE_CURRENT_SOURCE_DIR}/include"
-DZNC_EXPORT_LIB_EXPORT
-outdir "${CMAKE_CURRENT_BINARY_DIR}"
-o "${CMAKE_CURRENT_BINARY_DIR}/modperl_biglib.cpp"
+15
View File
@@ -0,0 +1,15 @@
// Make perl strings to be UTF-8, they are already UTF-8 in ZNC core
%fragment("SWIG_FromCharPtrAndSize","header") {
SWIGINTERNINLINE SV *
SWIG_FromCharPtrAndSize(const char* carray, size_t size) {
SV *obj = sv_newmortal();
if (carray) {
sv_setpvn(obj, carray, size);
} else {
sv_setsv(obj, &PL_sv_undef);
}
SvUTF8_on(obj);
return obj;
}
}
+2 -1
View File
@@ -61,7 +61,8 @@ class PString : public CString {
break;
case STRING:
default:
pSV = newSVpv(data(), length());
pSV = newSVpvn(data(), length());
SvUTF8_on(pSV);
break;
}