You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"AddDefaultCharset utf-8" should be added to main .htaccess file #1012
If you install OwnCloud on a server where the default charset is e.g. iso-8859-1 a lot of special characters are not properly displayed because OwnCloud uses utf-8 by default. Adding the option "AddDefaultCharset utf-8" to the main .htaccess file fixes the problem.
The default charset for OC is UTF-8 as is should be, and all headers contains <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />.
We had some errors in early releases where the database wasn't set up to use it, but they should be resolved by now.
If the data served, and the charset in the header is set explicitly, isn't it a browser error if it doesn't interpret it correctly?
If not we could probably set it in the headers without having to touch the webserver config, which would only work for a (large) subset of servers.
I've just tested it on a server where the default charset has been set to ISO-8859-1. All headers which were delivered contained Content-Type: text/html; charset=iso-8859-1. After I'd added "AddDefaultCharset utf-8" to the main .htaccess file of OwnCloud the delivered headers instantly changed to Content-Type: text/html; charset=utf-8 and all special characters were displayed properly. I think the best and easiest way to force utf-8 usage would be to add it to the main .htaccess file.
Hello. I had the same problem using OC in German environment. File scanning produced cutted files / directories in PREFIX_fscache. I eddited three files forcing utf8 encode / decode of files / directories. Is working fine now:
To insert files / directories with special chars: lib/filecache.php function put
change line: $result=$query->execute(array($parent,basename($fullpath),$fullpath, ...
to: $result=$query->execute(array($parent,basename(utf8_encode($fullpath)),utf8_encode($fullpath), ...
To open files with special chars: lib/files.php function get
add as first line in function: $files = utf8_decode($files);
To open directories with special chars: apps/files/index.php
change line: $dir = isset( $_GET['dir'] ) ? urldecode(stripslashes($_GET['dir'])) : '';
to: $dir = isset( $_GET['dir'] ) ? utf8_decode(urldecode(stripslashes($_GET['dir']))) : '';
Activity
DeepDiver1975 commentedon Dec 22, 2012
THX for the hint! Any idea how to define this in other web servers?
j-ed commentedon Dec 22, 2012
I'm using an Apache web server and there you can set this parameter in the web server configuration itself (http://httpd.apache.org/docs/2.2/de/mod/core.html) or by setting it via a .htaccess file.
tanghus commentedon Dec 22, 2012
The default charset for OC is UTF-8 as is should be, and all headers contains
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />.We had some errors in early releases where the database wasn't set up to use it, but they should be resolved by now.
If the data served, and the charset in the header is set explicitly, isn't it a browser error if it doesn't interpret it correctly?
If not we could probably set it in the headers without having to touch the webserver config, which would only work for a (large) subset of servers.
j-ed commentedon Dec 23, 2012
I've just tested it on a server where the default charset has been set to ISO-8859-1. All headers which were delivered contained Content-Type: text/html; charset=iso-8859-1.
After I'd added "AddDefaultCharset utf-8" to the main .htaccess file of OwnCloud the delivered headers instantly changed to Content-Type: text/html; charset=utf-8 and all special characters were displayed properly.
I think the best and easiest way to force utf-8 usage would be to add it to the main .htaccess file.
Merowinger commentedon Dec 23, 2012
Hello. I had the same problem using OC in German environment. File scanning produced cutted files / directories in PREFIX_fscache. I eddited three files forcing utf8 encode / decode of files / directories. Is working fine now:
To insert files / directories with special chars: lib/filecache.php function put
change line: $result=$query->execute(array($parent,basename($fullpath),$fullpath, ...
to: $result=$query->execute(array($parent,basename(utf8_encode($fullpath)),utf8_encode($fullpath), ...
To open files with special chars: lib/files.php function get
add as first line in function: $files = utf8_decode($files);
To open directories with special chars: apps/files/index.php
change line: $dir = isset( $_GET['dir'] ) ? urldecode(stripslashes($_GET['dir'])) : '';
to: $dir = isset( $_GET['dir'] ) ? utf8_decode(urldecode(stripslashes($_GET['dir']))) : '';
BernhardPosselt commentedon Feb 26, 2013
#1929
BernhardPosselt commentedon Feb 26, 2013
Please reopen if this issue has not been fixed in owncloud 5.0 master with the above pullrequest
BernhardPosselt commentedon Feb 26, 2013
@Merowinger please create a pull request to merge this if you want to