Skip to content

Commit

Permalink
Fix HTML raw printing with empty encoding
Browse files Browse the repository at this point in the history
Closes qzind#1152
  • Loading branch information
tresf committed Jun 30, 2023
1 parent 1d37b1f commit a7c0b7e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/qz/printer/action/PrintRaw.java
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public void parseData(JSONArray printData, PrintOptions options) throws JSONExce

private byte[] seekConversion(byte[] rawBytes, PrintOptions.Raw rawOpts) {
if (rawOpts.getSrcEncoding() != null) {
if(rawOpts.getSrcEncoding().equals(rawOpts.getDestEncoding())) {
if(rawOpts.getSrcEncoding().equals(rawOpts.getDestEncoding()) || rawOpts.getDestEncoding() == null) {
log.warn("Provided srcEncoding and destEncoding are the same, skipping");
} else {
try {
Expand Down Expand Up @@ -217,7 +217,7 @@ private ImageWrapper getHtmlWrapper(String data, JSONObject opt, PrintingUtiliti
// We'll toggle between 'plain' and 'file' when we construct WebAppModel
break;
default:
data = new String(seekConversion(flavor.read(data), rawOpts), rawOpts.getDestEncoding());
data = new String(seekConversion(flavor.read(data), rawOpts), destEncoding);
}

double density = (pxlOpts.getDensity() * pxlOpts.getUnits().as1Inch());
Expand Down

0 comments on commit a7c0b7e

Please sign in to comment.