-
Notifications
You must be signed in to change notification settings - Fork 193
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
Added charsetString variable #51
Conversation
Hi @Jako , can you test if the latest release is a fix for your problem? |
It could fix that maybe (haven't tested it yet). But in my opinion this fix has one big issue: You can only use chars that are in ISO-8859-1 in a vCard that way (http://php.net/manual/en/function.utf8-decode.php). And that charset is very limited: https://en.wikipedia.org/wiki/ISO/IEC_8859-1. A lot of eastern european signs are missing and all 'not latin' charsets are unsupported. It has to be written with UTF-8. |
As I said in my last comment, utf8_decode is somehow wrong, since the character set ISO-8859-1 is very limited. You can only handle western latin chars with that. The output has to be UTF-8 encoded and (because of some import limitations in i.e. Outlook) all vCard fields that could contain UTF-8 signs should be marked with |
Thanks @Jako |
* @param string $charset The charset for one property | ||
* @return void | ||
*/ | ||
public function setCharsetString($charset) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Jako, please remove this function and integrate this code into ->getCharsetString()
, since we already have our $this->charset; and ->setCharset($charset), your setCharsetString seems obsolete.
Hi @Jako, if you can just adjust your PR a little. Then i'll merge it, so special characters work in Windows and Android. |
- removed charsetString variable
Done. I have added a check for $this->charset == 'utf-8' inside, since I am not sure how other charsets have to be handled (if using a different internal charset). This way only a utf-8 charset changes the resulting vcf data. |
Added charsetString variable
Remove decoding utf8 for outlook, It fixed with pull request #51
It seems to be the only option to generate vCards for Windows (I have done some tests with 7-10 and Outlook) with UTF-8 charset strings by adding ;CHARSET=utf-8 to each line that could contain utf-8 signs. It is not enough to set only the mime header, as it should be according to https://tools.ietf.org/html/rfc6350.
The charsetString variable is empty by default to stay valid with the RFC, but it could be set with setCharsetString to support Windows vCard import implementations.