File: 0047-Revert-PDF-Output-Fix-regression-in-previous-release.patch

package info (click to toggle)
calibre 8.0.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 429,012 kB
  • sloc: python: 449,236; ansic: 87,143; javascript: 57,603; cpp: 18,698; xml: 1,245; sh: 922; sql: 735; objc: 330; makefile: 69; sed: 6
file content (31 lines) | stat: -rw-r--r-- 1,111 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Mon, 29 May 2023 23:45:27 +0900
Subject: Revert "PDF Output: Fix regression in previous release causing
 non-ascii entries to be incorrectly encoded into the PDF bookmarks"

Forwarded: not-needed

This reverts commit 00681544d8c9ef12930dd6ec8ae5a2118022587e.
---
 src/calibre/utils/podofo/utils.cpp | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/calibre/utils/podofo/utils.cpp b/src/calibre/utils/podofo/utils.cpp
index fb1fb01..ea11132 100644
--- a/src/calibre/utils/podofo/utils.cpp
+++ b/src/calibre/utils/podofo/utils.cpp
@@ -8,7 +8,6 @@
 #include "global.h"
 #include <sstream>
 #include <stdexcept>
-#include <string_view>
 
 using namespace pdf;
 
@@ -34,5 +33,5 @@ pdf::podofo_convert_pystring(PyObject *val) {
     Py_ssize_t len;
     const char *data = PyUnicode_AsUTF8AndSize(val, &len);
     if (data == NULL) throw std::runtime_error("Failed to convert python string to UTF-8, possibly not a string object");
-    return PdfString(std::string_view(data, len));
+    return PdfString::FromRaw(bufferview(data, len));
 }