You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2016/03/22 07:54:25 UTC
[jira] [Issue Comment Deleted] (PDFBOX-3281) HTML output wrongly
specifies UTF-16 in header
[ https://issues.apache.org/jira/browse/PDFBOX-3281?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr updated PDFBOX-3281:
------------------------------------
Comment: was deleted
(was: What would be the correct one? None? Utf-8? windows-1252? From what I see, the output is always "pure" ascii, and the "-encoding" setting is ignored:
{code}
private static void appendEscaped(StringBuilder builder, char character)
{
// write non-ASCII as named entities
if ((character < 32) || (character > 126))
{
int charAsInt = character;
builder.append("&#").append(charAsInt).append(";");
}
else
{
switch (character)
{
case 34:
builder.append(""");
break;
case 38:
builder.append("&");
break;
case 60:
builder.append("<");
break;
case 62:
builder.append(">");
break;
default:
builder.append(String.valueOf(character));
}
}
}
{code}
)
> HTML output wrongly specifies UTF-16 in header
> ----------------------------------------------
>
> Key: PDFBOX-3281
> URL: https://issues.apache.org/jira/browse/PDFBOX-3281
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 2.0.0
> Environment: OS X 10.11.4, Java 1.8.0_73-b02
> Reporter: Aaron Madlon-Kay
> Attachments: testdoc.html, testdoc.pdf
>
>
> When running the command line {{ExtractText}} with the {{-html}} flag, the output file always has the following meta tag specifying UTF-16 regardless of the actual output encoding:
> {code:html}
> <meta http-equiv="Content-Type" content="text/html; charset="UTF-16">
> {code}
> This causes editors that respect the meta tag (emacs, etc.) to garble the file content.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org