mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
Explain modperl that ZNC uses UTF-8 internally
Thanks to jiggawattz for showing the issue
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,8 @@ class PString : public CString {
|
||||
break;
|
||||
case STRING:
|
||||
default:
|
||||
pSV = newSVpv(data(), length());
|
||||
pSV = newSVpvn(data(), length());
|
||||
SvUTF8_on(pSV);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user