Merck / r2rtf

Easily Create Production-Ready Rich Text Format (RTF) Table and Figure
https://merck.github.io/r2rtf
GNU General Public License v3.0
76 stars 19 forks source link

Non converted characters #193

Closed toni-1991 closed 1 year ago

toni-1991 commented 1 year ago

Describe the bug There are characters not properly converted, due to they have a INT value when converted lower than 255, such us this one µ (extracted from the title of this webpage https://www.techtarget.com/whatis/definition/mu#:~:text=What%20is%20mu%20(%C2%B5)%3F,10%2D6%20or%20one%20millionth.)

Expected behavior I will expect that this and other values with a int lower than 255 is converted too.

To reproduce

r2rtf::utf8Tortf("µ") [1] "µ"

(When exported to an RTF, it produces unexpected extra characters µg)

Additional context This is not the only character where this will happen. In this webpage we have a list of UTF characters https://www.fileformat.info/info/charset/UTF-8/list.htm second column contain characters in format (U+0099), whenever this value when converted to decimal is lower than 255, and it's non an ascii character, like the ±, ², ¼ and many others

r2rtf::utf8Tortf("±") [1] "±" r2rtf::utf8Tortf("²") [1] "²" r2rtf::utf8Tortf("¼") [1] "¼"