Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with character encoding conversion on Alpine Linux #128

Closed
dpavlotzky opened this issue Sep 28, 2016 · 4 comments
Closed

Problems with character encoding conversion on Alpine Linux #128

dpavlotzky opened this issue Sep 28, 2016 · 4 comments

Comments

@dpavlotzky
Copy link

dpavlotzky commented Sep 28, 2016

Steps to reproduce

  1. Select an email

Expected behaviour

Email should be displayed in de display pane

Actual behaviour

Email is not shown

Mail app

Mail app version: 0.5.3

Mailserver or service: Dovecot with Postfix

Transport security - IMAP: STARTTLS

Transport security - SMTP: STARTTLS

Number of accounts: 1

Mail app version build date: (only if you are using a Nightly Build)

Server configuration

Operating system: Docker container with Alpine Linux

Web server: Nginx

Database: mariadb

PHP version: 7.0.10

Version: 10.0

**Updated from an older version or fresh install: Updated

List of activated apps:

Enabled:
  - activity: 2.3.2
  - admin_audit: 1.0.0
  - calendar: 1.4.0
  - comments: 1.0.0
  - contacts: 1.4.0.0
  - dav: 1.0.0
  - federatedfilesharing: 1.0.1
  - federation: 1.0.1
  - files: 1.5.2
  - files_accesscontrol: 1.1.2
  - files_automatedtagging: 1.1.1
  - files_pdfviewer: 0.8.1
  - files_sharing: 1.0.0
  - files_texteditor: 2.1
  - files_trashbin: 1.0.0
  - files_versions: 1.3.0
  - files_videoplayer: 0.9.8
  - firstrunwizard: 1.1
  - gallery: 15.0.0
  - mail: 0.5.3
  - notifications: 0.3.0
  - password_policy: 1.0.0
  - provisioning_api: 1.0.0
  - serverinfo: 1.1.1
  - survey_client: 0.1.5
  - systemtags: 1.0.2
  - templateeditor: 0.1
  - theming: 1.0.1
  - updatenotification: 1.0.1
  - user_external: 0.4
  - workflowengine: 1.0.1
Disabled:
  - encryption
  - external
  - files_external
  - files_retention
  - user_ldap
  - user_saml

The content of config/config.php:

{
    "system": {
        "apps_paths": [
            {
                "path": "\/usr\/share\/nginx\/nextcloud\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/data\/nextcloud\/apps",
                "url": "\/ownapps",
                "writable": true
            }
        ],
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "nextcloud.pavlotzky.nl"
        ],
        "datadirectory": "\/data\/nextcloud\/data",
        "overwrite.cli.url": "http:\/\/localhost",
        "dbtype": "mysql",
        "version": "9.1.0.16",
        "dbname": "nextcloud",
        "dbhost": "mariadb",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "logtimezone": "UTC",
        "installed": true,
        "instanceid": "ocpmn05ip3ed",
        "loglevel": 2,
        "maintenance": false,
        "updater.release.channel": "stable",
        "mail_from_address": "nextcloud",
        "mail_smtpmode": "php",
        "mail_domain": "pavlotzky.nl"
    }
}
#### Client configuration

Browser: Google Chrome

Operating system: MacOS Sierra

Logs

Web server error log
Insert your webserver log here
Server log (data/nextcloud.log)
Error   PHP iconv(): Wrong charset, conversion from `utf-8' to `utf-8//IGNORE' is not allowed at /data/nextcloud/apps/mail/lib/model/imapmessage.php#613
##### Horde IMAP log (data/horde_imap.log)
Insert your horde IMAP log here, see https://github.com/nextcloud/mail#debug-mode
##### Horde SMTP log (data/horde_smtp.log)
Insert your horde SMTP log here, see https://github.com/nextcloud/mail#debug-mode
##### Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log 
c) ...
@dpavlotzky
Copy link
Author

When I change the offending line from

$data = iconv($p->getCharset(), 'utf-8//IGNORE', $data);

to

$data = iconv($p->getCharset(), 'utf-8', $data);

The e-mail get displayed. Same if I use mbstring instead of iconv:

$data = mb_convert_encoding($data, 'utf-8//IGNORE', $p->getCharset());

does not work

$data = mb_convert_encoding($data, 'utf-8', $p->getCharset());

does.

This probably has to do with this functional difference between glibc and musl.

Is the //IGNORE part necessary?

@rnalrd
Copy link

rnalrd commented Feb 10, 2017

I can confirm that removing the "//IGNORE" part it works on Alpine 3.4.

@ChristophWurst
Copy link
Member

Fixed in #309.

@halfer
Copy link

halfer commented Sep 23, 2018

Related, and possibly of interest to future readers: phpearth/docker-php#3

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

No branches or pull requests

4 participants