I have made some code which exports some details of a journal article to a reference manager called Endnote
The format of which is a list of items like below (an author):
%A Schortgen Frédérique
Unfortunately, I am having some encoding problems somewhere, as when endnote opens the file, this is what it makes of the above author:
Schortge Frédérique
I have frantically tried playing around with the encoding and stuff that I am outputting and I am at a loss, here is the code:
Response.ContentType = _citation.ContentType; string fileExtension = ''; if (_citation.GetFileExtension() != null) fileExtension = '.' + _citation.GetFileExtension(); Response.AddHeader('content-disposition', 'attachment; filename=citation' + fileExtension); Response.ContentType = _citation.GetFileReferrer(); Response.Charset = 'UTF-8'; Response.write(-snip-); Response.End();
It looks like Endnote isn’t expecting UTF-8. Do you have details of what Endnote does expect? You may find that using Encoding.GetEncoding(1252) or Encoding.GetEncoding(28591) (which are Western codepage 1252 and ISO-8859-1 respectively) might work.
Btw, you’re setting Response.ContentType twice. That sounds unlikely to be a good thing.