Skip to content

Commit

Permalink
debugging issue of corrupted export to pdf on mac os (#2388)
Browse files Browse the repository at this point in the history
  • Loading branch information
giuspen committed Dec 9, 2023
1 parent b1f30b5 commit 7e25950
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ct/ct_export2pdf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -342,17 +342,17 @@ std::shared_ptr<CtPangoText> CtExport2Pango::_pango_link_url(const Glib::ustring
link_entry.type == CtConst::LINK_TYPE_FOLD)
{
std::string fileOrFold = link_entry.type == CtConst::LINK_TYPE_FILE ? link_entry.file.raw() : link_entry.fold.raw();
#ifdef _WIN32
#if defined(_WIN32) || defined(__APPLE__)
const std::string encoding = CtStrUtil::get_encoding(fileOrFold.c_str(), fileOrFold.size());
if (encoding == "ASCII") {
uri = (Glib::path_is_absolute(fileOrFold) ? "uri='file://":"uri='") + str::xml_escape(fs::path{fileOrFold}.string_unix()) + "'";
}
else {
uri = "uri='file://non_supported_encoding_" + encoding + "'";
}
#else // !_WIN32
#else /* !_WIN32 && !__APPLE__ */
uri = (Glib::path_is_absolute(fileOrFold) ? "uri='file://":"uri='") + str::xml_escape(fileOrFold) + "'";
#endif // !_WIN32
#endif /* !_WIN32 && !__APPLE__ */
}
else {
spdlog::debug("invalid link entry {}, text {}", link, tagged_text);
Expand Down

0 comments on commit 7e25950

Please sign in to comment.