Comments (4)
Could you provide your session information using sessionInfo()
?
I can not reproduce the issue from Posit Cloud https://posit.cloud
Below is the output I get.
> library(r2rtf)
> utf8ToInt("表")
[1] 34920
> utf8ToInt("a")
[1] 97
One possibility is that your computer is not using UTF-8 encoding. Please check the encoding by
> Encoding("表")
[1] "UTF-8"
from r2rtf.
Thanks for the suggestions.
- For Chinese characters, please refer #89 and uses
r2rtf:::utf8Tortf
function. - You can set
text_convert = FALSE
inrtf_colheader
andrtf_body
etc to avoid replacing_
to\sub
.
from r2rtf.
Thanks for the answer.
The reason that I tried to replaced \fcharset161
with \fcharset134
was the function r2rtf:::utf8Tortf
which didn't work.
the code:
final %>%
rtf_page(orientation = "landscape") %>%
rtf_title(r2rtf:::utf8Tortf("表3.1 AL01211单剂量递增研究PK参数汇总(PKS)")) %>%
rtf_colheader(
colheader = "剂量组|统计_量| Cmax\n (ng/mL)|tmax\n (h) |t1/2\n (h)| CL/F\n (L/h)|VZ/F\n (L)|AUC0-24h\n (ng/mL·h)
|AUC0-last\n (ng/mL·h)|AUC0-\\infty\n (ng/mL·h)|Kel\n (1/h)|%AUCexp\n (%)|CLr\n (L/h)"
) %>%
rtf_body() %>%
rtf_encode() %>%
write_rtf("Outputs/TFLs/T_3_1-2.rtf")
I couldn't figure out why the result of r2rtf:::utf8Tortf
was NA
.
> r2rtf:::utf8Tortf("表3.1 AL01211单剂量递增研究PK参数汇总(PKS)")
[1] "NA"
Whether is the problem of function utf8ToInt
?
> utf8ToInt("表")
[1] NA
> utf8ToInt("a")
[1] 97
from r2rtf.
You are right. The locale isn't UTF-8
.
> Encoding("表")
[1] "unknown"
> sessionInfo()
locale:
[1] LC_COLLATE=English_United States.936 LC_CTYPE=English_United States.936
[3] LC_MONETARY=English_United States.936 LC_NUMERIC=C
[5] LC_TIME=English_United States.936
I set locale to UTF-8
.
Sys.setlocale("LC_ALL", "German.UTF-8")
Then all chinese character displayed right.
Thanks very much again!
from r2rtf.
Related Issues (20)
- Page size of the first page is different from the other pages HOT 1
- `assemble_rtf` error/warning message HOT 3
- Using `cell_justification` provide unexpected results with `page_by`. HOT 1
- Pkgdown fails on Master HOT 1
- styler CI/CD fail HOT 1
- Non converted characters
- border_first & page_by HOT 3
- Variations in RTF output across package versions HOT 1
- rtf_subline & page_by HOT 2
- Stop assemble_rtf applying header/footer from last .rtf to entire document HOT 7
- Recreating HAMD17 data HOT 1
- Set different border widths within a section HOT 4
- Remove border between the header and body HOT 1
- Is it possible to add a long free text? HOT 5
- Create FAQ vignette HOT 2
- Refresh RTF and derived artifacts under `vignettes/`
- Release r2rtf 1.1.1 HOT 1
- Unnecessary SVG saving in tests?
- Logo.png in page header for summary tables- RTF format HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r2rtf.