Skip to content

[Feature] Filename encoding with gbk standard should be supported #5676

Closed

Description

@ericlin1001

Steps to reproduce

  1. In linux, use owncloud client(owncloud version 2.3.0 Using Qt 4.8.6)
  2. In the owncloud syncing directory.
  3. touch 乱码.txt
  4. convmv -f utf-8 -t gbk 乱码.txt
  5. owncloud complained: *???.txt could not be synced due to errors. *
  6. In log, I found: File ignored because of invalid utf-8 sequence: ???.txt

Expected behaviour

Tell us what should happen
The file with name encoding in gbk, should be synced. Because I'm converting file name encoding of a large amount of files in linux, and these files are to be used in windows(win7).

Actual behaviour

Tell us what happens instead

  1. owncloud complained: *???.txt could not be synced due to errors. *
  2. In log, I found: File ignored because of invalid utf-8 sequence: ???.txt

Server configuration

Operating system:
LSB Version: core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:core-4.0-amd64:core-4.0-noarch:core-4.1-amd64:core-4.1-noarch:security-4.0-amd64:security-4.0-noarch:security-4.1-amd64:security-4.1-noarch
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

Web server:

Database:

PHP version:

ownCloud version: (see ownCloud admin page)

Updated from an older ownCloud or fresh install:

Where did you install ownCloud from:

Signing status (ownCloud 9.0 and above):

Login as admin user into your ownCloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your ownCloud installation folder

The content of config/config.php:

If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your ownCloud installation folder

or 

Insert your config.php content here
(Without the database password, passwordsalt and secret)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your ownCloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser:

Operating system:

Logs

Web server error log

Insert your webserver log here

ownCloud log (data/owncloud.log)

Insert your ownCloud log here

Browser log

Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...

Activity

  1. hodyroff commented on Apr 3, 2017

    @hodyroff

    We are currently preparing 2.3.1 packages with QT5.6 as new Linux packages, those will be worth a try first and then we might be able to look into this.

  2. added this to the 2.3.2 milestone on Apr 4, 2017
  3. changed the title [-]Filename encoding with gbk in Linux, will not be synced![/-] [+][Linux] Filename encoding with gbk will not be synced[/+] on Apr 4, 2017
  4. guruz commented on Apr 4, 2017

    @guruz
    Contributor

    I heard from the other engineers that we only support UTF-8 on the client side, sorry.

  5. ericlin1001 commented on Apr 5, 2017

    @ericlin1001
    Author

    Ok, that's fine. Though I'm still hoping it'll support all file name encoding. Because with it, life will be more easy.

  6. changed the title [-][Linux] Filename encoding with gbk will not be synced[/-] [+][Feature] Filename encoding with gbk standard should be supported[/+] on Apr 5, 2017
  7. removed this from the 2.3.2 milestone on Apr 5, 2017
  8. 22 remaining items

  9. ogoffart commented on Nov 21, 2017

    @ogoffart
    Contributor

    I tested:

    unset LC_ALL
    unset LC_CTYPE
    export LANG=en_US
    

    (en_US is specified in my /etc/locale.gen as en_US ISO-8859-1)
    I verified that the codecForLocale is indeed latin1.
    Filename that can be encoded as latin1 works as expected.

    However the bug i noticed is that if the server contains filename that cannot be encoded in the user's locale, Qt uses replacement character instead ('?'). And next sync rename the file with the replacement character.

  10. added
    ReadyToTest
    on Nov 28, 2017
  11. guruz commented on Jul 23, 2018

    @guruz
    Contributor
  12. jnweiger commented on Aug 5, 2018

    @jnweiger
    Contributor

    Mint Tara (aka Ubuntu 18.04)

    testpilotcloud version 2.5.0daily20180801 (build 9974)

    touch 乱码.txt
    ... syncs fine.
    convmv -f utf-8 -t gbk 乱码.txt --notest
    ... but then we still get a sync error as reported by the OP:
    grafik

    This feature does not seem to be ready for 2.5.0 release.

    @ckamm I understand the expected outcome should be: file ignored.
    Maybe 7d70f1b only sets the ignore flag when down-syncing? This was asked for upwards (too).

    My personal opinion (aka server enhancement idea): filenames should be opaque byte streams for us. Whatever bytes a user puts into owncloud, should store that and bring it back unchanged. Interpreting encoding of a filename is a problem of the representation layer, not of the transport layer.

  13. michaelstingl commented on Aug 5, 2018

    @michaelstingl
    Contributor

    My personal opinion (aka server enhancement idea): filenames should be opaque byte streams for us.

    @jnweiger Could you open or link to an issue in core and elaborate on your idea?

  14. ogoffart commented on Aug 6, 2018

    @ogoffart
    Contributor

    @jnweiger that's because your locale is still UTF-8. So it is expected that when a filename is not in UTF-8, we show one error for this file. (but we still continue to sync the other files)

    My personal opinion (aka server enhancement idea): filenames should be opaque byte streams for us. Whatever bytes a user puts into owncloud, should store that and bring it back unchanged. Interpreting encoding of a filename is a problem of the representation layer, not of the transport layer.

    That's not really possible as you need to display the filename in the web interface from HTML whose encoding is UTF-8. And since you need to sync, you need to compare the filename for equality. So we need to understand what it is. And we can't sync invalid filename.

  15. jnweiger commented on Aug 6, 2018

    @jnweiger
    Contributor

    Client observing the local locale is actually cool! So correct behaviour there!
    Some more tests:

    Mint Tara (aka Ubuntu 18.04)

    locale LC_ALL=de_DE.UTF-8

    LC_CTYPE= LANG=C LC_ALL=C LANGUAGE=C testpilotcloud &

    touch xxx.txt; sleep 10 # sufficient sleep so that it syncs
    mv xxx.txt x乱码.txt
    OK

    • syncs up fine.

    Client Error log:

    • 6 Aug 2018 16:51:25, Documents/issue5676/x������.txt, testpilotcloud3, The filename cannot be encoded on your file system.

    BUT: the file gets renamed on the server.

    • local changes are no longer synced up.
    • changes on the server are no longer synced down.

    OK:
    Files that 'cannot be encoded on your file system' according to the locale of the owncloud-client (LC_ALL=C) in this case are rejected with the correct error message.

    BUT:

    • touch 乱码.txt
      Different error message: 'File Removed'. But the file was not removed.
  16. jnweiger commented on Aug 6, 2018

    @jnweiger
    Contributor

    @ogoffart Regarding byte-streams.
    I believe both your points are invalid/can be worked around. Let's move that discussion to the server space: owncloud/core#32251

  17. jnweiger commented on Aug 8, 2018

    @jnweiger
    Contributor

    The behaviour seen in #5676 (comment) is as expected. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

ReadyToTest

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions