MS "VCard" French special characters

I am trying to create a vcard on the fly for the site. I just open the “real” VCard after creating it using Outlook using Notepad ++ and see what I need to create it on the fly. Everything works fine, and I can add everything I need, where I need. Instead of a single point:

  • All French characters, such as É, À, Ê, Ç, etc., are shown like this: Simon Dugr à © .

I added everything that Outlook suggested, created by those who offer to add: "CHARSET = Windows-1252:" before my string entry (I also tried using ISO-8859-1, UTF8, UTF7, UTF-8, UTF-7), I added and none of them work.

Any suggestion?

EDIT (after Alexander S.'s answer)
Here is the source of VCard. Note that the source shows this correctly, but when I open it in Outlook, I still have an accent problem:

START: VCARD Version: 2.1
N; LANGUAGE = FR-cha; CHARSET = UTF-8: Dugré; Simon
ORG; Charset = UTF-8: CompanyNameéàêâç
TEL; WORK; VOICE: 5555555555
X-MS-OL-DEFAULT-MAIL-ADDRESS: 0
EMAIL; PREF; INTERNET: hello@world.com X-MS-OL-DESIGN; CHARSET = utf-8: [HTML VCard format] REV: 20110404T135700 END: VCARD


+5
source share
5 answers

Here is a good line :

currentPage.Response.AddHeader("Content-Disposition", string.Format("attachment; filename={0} {1}.vcf", this.FirstName, this.LastName));
currentPage.Response.ContentType = "text/x-vcard";
currentPage.Response.ContentEncoding = System.Text.Encoding.GetEncoding("ISO-8859-1"); // THIS LINE
currentPage.Response.Write(content);
currentPage.Response.End();

Instead:

currentPage.Response.Charset = "ISO-8859-1";
+1

CHARSET=utf-8, CHARSET=utf-8.

vCard , , Outlook .

+5

utf8 utf-8 .

0

, .

<%@ Page Language="C#"  CodePage=1252 %>
<%
Response.Charset ="windows-1252";
Response.ContentType="text/x-vcard";
Response.AddHeader("Content-Disposition", "attachment; filename=test.vcf" );
 %>
BEGIN:VCARD
VERSION:2.1
N:;Dugré;Simon
FN:Simon Dugré
ORG:CompanyNameéàêâç
TEL;WORK;VOICE:5555555555
EMAIL;PREF;INTERNET:hello@world.com
REV:20110405T164322Z
END:VCARD

Outlook 2003.

0

( ). , utf-8 Outlook - . utf-8:

Response.ContentType = "text/x-vcard; charset=UTF-8";

Response.HeaderEncoding = Encoding.GetEncoding("UTF-8");

Response.ContentEncoding = Encoding.GetEncoding("UTF-8");

Response.Charset = "UTF-8";

Windows-1250, ( ) ! , :

Response.ContentEncoding = Encoding.GetEncoding("Windows-1250");

vCard , .

0

All Articles