本文介绍了RStudio控制台中的非英语(希伯来语)输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下测试在我的笔记本电脑上工作正常,但在运行Windows 10的HP EliteOne 800上却出现错误

H <- "שלום"

H

在出现问题的机器上

我测试了几种编码,例如

Encoding(H)  <- "ISO-8859-1"

给出相同的输出,并且

Encoding(H)<-"UTF-8"
H

产生

下面是对

的回复

sessionInfo()

任何帮助将不胜感激,

阿维

解决方案

谢谢您,理查德,您将我引向了一个行之有效的解决方案-尽管我不明白为什么.我玩过各种代码,但不小心将语言环境更改为日语,并且有效.比我测试了其他各种语言环境,它们做的技巧相同.如果有人知道为什么希伯来语不能与希伯来语区域设置一起使用,我想知道.下面是代码及其产品:

> [1]ùìåí" #希伯来语中的问题

[1]"LC_COLLATE =希伯来语以色列.1255; LC_CTYPE =希伯来语以色列.1255; LC_MONETARY =希伯来语以色列.1255; LC_NUMERIC = C; LC_TIME =希伯来语以色列.1255"

[1]"LC_COLLATE =希伯来语以色列.1255; LC_CTYPE =希伯来语以色列.1255; LC_MONETARY =希伯来语以色列.1255; LC_NUMERIC = C; LC_TIME =希伯来语以色列.1255"

> [1]ùìåí" #希伯来语中的问题

[1] LC_COLLATE =希伯来语以色列.1255; LC_CTYPE =希伯来语以色列.1255; LC_MONETARY =希伯来语以色列.1255; LC_NUMERIC = C; LC_TIME =希伯来语以色列.1255"

[1]"LC_COLLATE = Japanese_Japan.932; LC_CTYPE = Japanese_Japan.932; LC_MONETARY = Japanese_Japan.932; LC_NUMERIC = C; LC_TIME = Japanese_Japan.932"

> H<-שלום" #其他可行的语言解决方案-也请参见下面的

[1]שלום"

[1]שלום"

[1]שלום"

The following test works fine on my laptop, but produces an error on my HP EliteOne 800 running Windows 10

H <- "שלום"

H

In the machine with the problem I get

I tested several encoding, such as

Encoding(H)  <- "ISO-8859-1"

which gives the same output, and

Encoding(H)<-"UTF-8"
H

that produces

Below is the response to

sessionInfo()

Any help will be appreciated,

Avi

解决方案

Thank you Richard, you led me to a solution that works -- although I do not understand why. I played with various codes, and accidentally changed my locale to Japanese and it works. Than I tested various other locales and they do the same trick. If any one knows why the Hebrew does not work with Hebrew locale, I would like to know. Below is the code and its product:

> [1] "ùìåí" #THE PROBLEM IN HEBREW

[1]"LC_COLLATE=Hebrew_Israel.1255;LC_CTYPE=Hebrew_Israel.1255;LC_MONETARY=Hebrew_Israel.1255;LC_NUMERIC=C;LC_TIME=Hebrew_Israel.1255"

[1]"LC_COLLATE=Hebrew_Israel.1255;LC_CTYPE=Hebrew_Israel.1255;LC_MONETARY=Hebrew_Israel.1255;LC_NUMERIC=C;LC_TIME=Hebrew_Israel.1255"

> [1] "ùìåí" #THE PROBLEM IN HEBREW

[1]LC_COLLATE=Hebrew_Israel.1255;LC_CTYPE=Hebrew_Israel.1255;LC_MONETARY=Hebrew_Israel.1255;LC_NUMERIC=C;LC_TIME=Hebrew_Israel.1255"

[1]"LC_COLLATE=Japanese_Japan.932;LC_CTYPE=Japanese_Japan.932;LC_MONETARY=Japanese_Japan.932;LC_NUMERIC=C;LC_TIME=Japanese_Japan.932"

> H <- "שלום" #THE SOLUTION IN OTHER LANGUAGE THAT WORKS -- ALSO SEE BELOW

[1] "שלום"

[1] "שלום"

[1] "שלום"

这篇关于RStudio控制台中的非英语(希伯来语)输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-14 16:30