pdftools converting hieroglyph

Hello. Previously, pdftools encoded the hieroglyphs in this format <U+52D9>, and now like this 零. How can I go back to the first format?


thanks for your question @Alex

any ideas on this @jeroenooms ?

Can you please include example code and an example pdf and specify when was previously? Which version number of pdftools/r/windows?

Code is simple:
txt <- pdf_text(path)

previous configuration:
ubuntu 16.04
R version 3.4.4 (2018-03-15)
Pdftools 1.8,

Ubuntu 18.04.2 LTS
R version 3.4.4 (2018-03-15)
Pdftools 2.1
I installed previous versions of libraries, it did not help.
Link on all files https://yadi.sk/d/gVPpSmpMzDyl2Q
I not found how attach it here.

I think the difference is in your locale, not the version of pdftools. R automatically escapes non-ascii strings when you are in C locale.

 txt <- pdf_text(path)

And now try this:

Sys.setlocale(locale = "C")

However I would not recommend this. If you really want to get escape sequences you could use stringi:


That should properly escape utf-8 characters on any locale.

1 Like

Thank you. This Sys.setlocale(locale = ā€œCā€) help me.

1 Like