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

Quoted Umlaut 'ß' (Unicode U+00DF) in wrong encoding #12

Closed
GoogleCodeExporter opened this issue Mar 21, 2015 · 6 comments
Closed

Quoted Umlaut 'ß' (Unicode U+00DF) in wrong encoding #12

GoogleCodeExporter opened this issue Mar 21, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?

1. Parse this String via Ezvcard.parse().first()

BEGIN:VCARD
FN;quoted-printable:Max Ma=DF
TEL;voice:+49123123
END:VCARD

2. Access FormattedName via VCard-Api 
vCard.getFormattedName().getValue()


What is the expected output?
Max Maß

What is the actual output?
Max Ma�

What version of ez-vcard are you using?
0.9.1

What version of Java are you using?
1.7.0_17

Original issue reported on code.google.com by f.gaff...@googlemail.com on 7 Jan 2014 at 12:31

@GoogleCodeExporter
Copy link
Author

Also with Java 1.7.0_45

Original comment by f.gaff...@googlemail.com on 7 Jan 2014 at 2:24

@GoogleCodeExporter
Copy link
Author

Adding a CHARSET parameter to the FN property should solve the issue:

BEGIN:VCARD
FN;quoted-printable;CHARSET=ISO-8859-1:Max Ma=DF
TEL;voice:+49123123
END:VCARD

This parameter tells the vCard parser what character set the quoted-printable 
value is in.

Original comment by mike.angstadt on 7 Jan 2014 at 9:11

@GoogleCodeExporter
Copy link
Author

Thanks a lot Mike for this fast responding, it works!

I work with an API which don't set the charset-encoding.

It is maybe a nice Feature to be able to set the encoding manually in the 
Ezvcard.parse()-method.

What is the default encoding if there no CHARSET-parameter has been set, like 
in this case? ASCII?

Original comment by f.gaff...@googlemail.com on 8 Jan 2014 at 8:18

@GoogleCodeExporter
Copy link
Author

It will first attempt to find the character encoding of the Reader object.  If 
the Reader object doesn't have one (for example, if you are reading from a 
String object), then it will use your system's default character encoding.

I'll work on a way to set the encoding manually.

Original comment by mike.angstadt on 8 Jan 2014 at 1:26

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

The default encoding could be set (REST, UTF-8), but the implementation seems 
to be not very consistent. So the fault is caused by the API-provider...

But I think that will be a nice feature for the future. Thanks a lot for your 
working on this very nice Java lib!

Original comment by f.gaff...@googlemail.com on 8 Jan 2014 at 3:27

@GoogleCodeExporter
Copy link
Author

Fix completed.  You can now call a method to set a default character set for 
decoding quoted-printable properties that do not have a CHARSET parameter.

Charset charset = Charset.forName("ISO-8859-1");
VCard vcard = 
Ezvcard.parse(...).defaultQuotedPrintableEncoding(charset).first();

Original comment by mike.angstadt on 16 Jan 2014 at 4:03

  • Changed state: Fixed

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

1 participant