diff options
| author | Roland Stigge <stigge@antcom.de> | 2018-01-07 17:25:24 +0100 | 
|---|---|---|
| committer | Roland Stigge <stigge@antcom.de> | 2018-01-07 17:25:24 +0100 | 
| commit | ae248732206b6b04dd476cef03f08c427c333b14 (patch) | |
| tree | bfec347b4d1bf3ba8b6b2e350b93751f59ea12f3 | |
| parent | e3832b3ee4b0bf10c05e8c3fab61d02e7420c8fd (diff) | |
Fix Umlaut handling
| -rw-r--r-- | src/webbox.cpp | 10 | 
1 files changed, 9 insertions, 1 deletions
| diff --git a/src/webbox.cpp b/src/webbox.cpp index d1e2c50..71f023c 100644 --- a/src/webbox.cpp +++ b/src/webbox.cpp @@ -43,7 +43,15 @@ QString httpError(int httpStatusCode, QString message) {  	return QString("Status: %1 %2\r\nContent-Type: text/html\r\n\r\n<html><body><h1>%1 %2</h1><p>%3</p></body></html>\r\n").arg(httpStatusCode).arg(description).arg(message);  } +void initlocale() { +	if (setenv("LC_ALL", "UTF-8", 1)) { +		exit(1); +	} +} +  int main(int argc, char* argv[]) { +	initlocale(); +  	int result = FCGX_Init();  	if (result != 0) {  		return 1; // error on init @@ -444,7 +452,7 @@ int main(int argc, char* argv[]) {  								if (end == -1) {  									FCGX_PutS(QString("Error reading filename / end").toUtf8().data(), request.out);  								} else { -									QString filename = content.mid(start, end - start); +									QString filename = QString::fromUtf8(content.mid(start, end - start));  									if (filename.size() < 1) {  										FCGX_PutS(QString("Bad filename").toUtf8().data(), request.out); | 
