2
Xerces 트랜스 코드가 빈 문자열을 반환합니다. 나는 그것이 로케일 문제와 관련이 있다고 생각하지만, 나는 붙어있다. Xerces XMLString :: transcode null/empty reply
나는이 간단한 프로그램이 있습니다#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/framework/MemBufInputSource.hpp>
#include <xercesc/dom/DOMException.hpp>
#include <string>
#include <stdio.h>
XERCES_CPP_NAMESPACE_USE
using namespace std;
int main(int argc, char* argv[])
{
string a = "Não";
try
{
XMLPlatformUtils::Initialize("pt_PT");
} catch(const XMLException& e)
{
fprintf(stdout,"ERROR INITIALIZING\n");
}
XMLCh *auxCh3 = XMLString::transcode(a.c_str());
fprintf(stdout,"### %s ###\n",XMLString::transcode(auxCh3));
XMLString::release(&auxCh3);
XMLPlatformUtils::Terminate();
return 0;
}
을 그리고 그 결과는 다음과 같습니다
"### ###"나는이 (가)를 제거하면
이 결과는 괜찮 :
는는 "### 없음 ###"
서버의 로케일에 정의되지 않은 :
[]$ locale
LANG=pt_PT
LC_CTYPE="pt_PT"
LC_NUMERIC="pt_PT"
가능한 중 하나입니다 : 당신의 도움에 대한
[]$ locale -a|grep pt_PT
pt_PT
감사합니다.