在字符串中使用希伯来字符 [英] Using Hebrew characters in string

查看:188
本文介绍了在字符串中使用希伯来字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在R中的字符串中使用希伯来字符。
我使用以下命令:

I would like to use Hebrew characters in string in R. I used the following:

> a<-c("משה")
> a
[1] "îùä"
> class (a)
[1] "character"

当我输出字符串的内容或使用任何函数。如何使用希伯来字符?

As can be seen I get Jibbrish when I output the content of the string or using any functions. How can I use Hebrew characters?

推荐答案

感谢这里的所有意见是答案:
如果我使用是的,我得到Jibbrish:

Thanks to all the comments here is the answer: If I use it as is, I get Jibbrish:

> a<-"משה"
> a
[1] "îùä"

然而,如果我将它编码为UTF8,正确的结果:

However if I encode it to UTF8 I get the right result:

> a<-enc2utf8( "משה")
> a
[1] "משה"

我希望有一种方法编码。

I wish there was a way to do it without encoding.

这篇关于在字符串中使用希伯来字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆