这是python中的一些转换,语言环境是“utf-8”
>>> s1="你好" #你好 = how are you?
>>> s2=unicode(s1,"utf-8")
>>> s2
u'\u4f60\u597d' #s2 is the unicode form of s1
>>> s3=s2.encode("utf-8")
>>> s3
'\xe4\xbd\xa0\xe5\xa5\xbd' #s3 is the utf-8 form of s1
>>> s4=s2.encode("gbk")
>>> s4
'\xc4\xe3\xba\xc3' #s3 is the gbk form of s1
我怎么能在R中做到这一点?