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

Fix com_contact > created vcf in contactform can´t handle german umlauts (issue #7937) #7938

Closed
wants to merge 5 commits into from
Closed

Conversation

coolcat-creations
Copy link
Contributor

@coolcat-creations coolcat-creations commented Sep 24, 2015

Steps to reproduce the issue

Put in some contact information with ß ä ö ü inside and enable the Option .vcf for the contact view.
Download the vcf

Expected result

The vcf should contain the umlauts.

Actual result

On Apple devices the umlauts are shown correctly but but not in outlook on windows.

System information (as much as possible)

Additional comments

I added utf8decoding in the code, that fixes the problem. As i´m not a developer please review also the way how i fixed it.

This fixes issue: #7937

@coolcat-creations coolcat-creations changed the title Fix com_contact > created vcf in contactform can´t handle german umlauts #7937 Fix com_contact > created vcf in contactform can´t handle german umlauts (issue #7937) Sep 24, 2015
@rdeutz
Copy link
Contributor

rdeutz commented Sep 24, 2015

Not bad for a non developer :-)

Indentation gets lost somewhere and the comment is in German, fine for me but not the usual way we are doing it. Some code style issues on top.

Pretty normal for the first PR :-)

@infograf768
Copy link
Member

This breaks UTF8 characters here.
utf8_decode converts a UTF8 string into ISO-8859-1

so it may work for some latin characters (for example with umlauts) but not for Greek or Chinese, etc.

@rdeutz
Copy link
Contributor

rdeutz commented Sep 24, 2015

@infograf768 does it work with Greek/Chinese without this patch?

@infograf768
Copy link
Member

It does on Macintosh:
I added ä ݑώ⽋ i.e. an umlaut, an arabic, a greek and a japanese character in a few fields.
This is the vcf I get before this PR

BEGIN:VCARD
VERSION:3.0
N:Here;Contact;Name
FN:Contact Name Here
TITLE:Position ä ݑώ⽋
TEL;TYPE=WORK,VOICE:2224556
TEL;TYPE=WORK,FAX:Fax
TEL;TYPE=WORK,MOBILE:
ADR;TYPE=WORK:;;Street ä ݑώ⽋;City ä ݑώ⽋;State ä ݑώ⽋;;country ä ݑώ⽋
LABEL;TYPE=WORK:Street ä ݑώ⽋
City ä ݑώ⽋
State ä ݑώ⽋

country ä ݑώ⽋
EMAIL;TYPE=PREF,INTERNET:email@xn----7sblgc4ag8bhcd.xn--p1ai
URL:http://www.xn----7sblgc4ag8bhcd.xn--p1ai/master
REV:2015-09-24T09:47:00+02:00Z
END:VCARD 

This is what we get after this patch...

BEGIN:VCARD
VERSION:3.0
N:Here;Contact;Name
FN:Contact Name Here
TITLE:Position ä ???
TEL;TYPE=WORK,VOICE:2224556
TEL;TYPE=WORK,FAX:Fax
TEL;TYPE=WORK,MOBILE:
ADR;TYPE=WORK:;;Street ä ???;City ä ???;State ä ???;;country ä ???
LABEL;TYPE=WORK:Street ä ???
City ä ???
State ä ???

country ä ???
EMAIL;TYPE=PREF,INTERNET:email@xn----7sblgc4ag8bhcd.xn--p1ai
URL:http://www.xn----7sblgc4ag8bhcd.xn--p1ai/master
REV:2015-09-24T09:47:00+02:00Z
END:VCARD

Each non-latin glyph is replaced by a ?

@coolcat-creations
Copy link
Contributor Author

@infograf768 on a apple it works with german umlauts also, but not in win outlook

@infograf768
Copy link
Member

on a apple it works with german umlauts also, but not in win outlook

Yes, as stated in the link I gave above. We can't though provide wrong vcf because Windows is a piece of s... 😄

In any case the solution provided here does not work.

@balzercomp
Copy link

You should add the charset to the lines containing the value.
For UTF-8 this means:
FN:Contact Name Here
becomes
FN;CHARSET=UTF-8:Contact Name Here

@infograf768
Copy link
Member

all what i have read on the net says it will not help for microsoft apps.

@balzercomp
Copy link

You're right. I just tested it on the latest outlook with win 10. Doesn't work. Seems that microsoft doesn't obey standards again. Vcard version 3.0 requires the values to be in UTF-8.

@balzercomp
Copy link

Maybe it would be useful to build a switch that allows to export in different codesets depending on the browser's OS.

@infograf768
Copy link
Member

Not so simple:

  1. Check that the string concerned contains ONLY glyphs that can be converted to ISO-8859-1
    (or CP1252 for windows)
  2. Check that the browser OS is Windows
  3. Change the vcard version to 2.1 (3.0 does not use charset and has to be utf8)
  4. Add the charset if all the conditions are met.

@infograf768
Copy link
Member

In any case the view
ROOT/components/com_contact/views/contact/view.vcf.php
can be overriden in the template if one is sure all contacts info will be ISO-8859-1
List is here:
http://goodtools.net/pages/HowCharactersMap.html

@Hackwar
Copy link
Member

Hackwar commented Feb 23, 2016

Sorry, but based on the feedback by @infograf768 and that this seems to be a bug in Outlook, I think this PR should be closed. I'm not using Outlook on my Windows system and I'd rather have standards-compliant output than account for one program. (Even though it is admittedly the one with the largest distribution)

@roland-d
Copy link
Contributor

From what I understand it now doesn't work anywhere with UTF-8 characters, at least with the patch it works for people using a Mac? Is that correct? If so, I believe we should more this forward otherwise we may as well close it.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7938.

@brianteeman
Copy link
Contributor

No. @infograf768 said it worked on a Mac without this patch


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7938.

@roland-d roland-d changed the title Fix com_contact > created vcf in contactform can´t handle german umlauts (issue #7937) Fix com_contact > created vcf in contactform can´t handle german umlauts (issue #7937) Jul 31, 2016
@roland-d roland-d closed this Jul 31, 2016
@roland-d
Copy link
Contributor

Closing this PR because it can't solve the issue. Thank you for your contribution.


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7938.

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

Successfully merging this pull request may close these issues.

None yet

9 participants