Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3487740
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:11:10+00:00 2026-05-18T11:11:10+00:00

I would like to know how to set the encoding parameter so that when

  • 0

I would like to know how to set the encoding parameter so that when I download text, it ‘looks’ the same as when I saw it on the page source in a web browser, e.g.:

readLines("http://www.baidu.com/s?wd=r+project")[132]
[1] "<div id=\"foot\">&copy;2010 Baidu <span>´ËÄÚÈÝϵ°Ù¶È¸ù¾ÝÄúµÄÖ¸Áî×Ô¶¯ËÑË÷µÄ½á¹û£¬²»´ú±í°Ù¶ÈÔ޳ɱ»ËÑË÷ÍøÕ¾µÄÄÚÈÝ»òÁ¢³¡</span></div>"

When it should be displayed as:

> <div id="foot">&copy;2010 Baidu <span>此内容系百度根据您的指令自动搜索的结果,不代表百度赞成被搜索网站的内容或立场</span></div> 

Any help would be much appreciated!

# windows 7
sessionInfo()
R version 2.12.0 (2010-10-15)
Platform: x86_64-pc-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United Kingdom.1252 
[2] LC_CTYPE=English_United Kingdom.1252   
[3] LC_MONETARY=English_United Kingdom.1252
[4] LC_NUMERIC=C                           
[5] LC_TIME=English_United Kingdom.1252    

attached base packages:
[1] stats     graphics  grDevices datasets  utils     methods   base     

other attached packages:
[1] XML_3.2-0.1    RCurl_1.4-4.1  bitops_1.0-4.1 rcom_2.2-3.1   rscproxy_1.3-1

loaded via a namespace (and not attached):
[1] tools_2.12.0
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T11:11:11+00:00Added an answer on May 18, 2026 at 11:11 am
    con = url("http://www.baidu.com/s?wd=r+project",  encoding = "gb2312")
    readLines(con)[132] 
    [1] "<div id=\"foot\">&copy;2010 Baidu <span>此内容系百度根据您的指令自动搜索的结果,不代表百度赞成被搜索网站的内容或立场</span></div>"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make sure that everything I know about UTF-8 is correct.
I would like to know if it's possible to set the size of VARCHAR
I would like to know if it's possible to set specific ruby environments to
I would like to know how I can set the MySQL time zone to
I would like to know if there is a standard to set the order
I would like to know how to find the rotation matrix for a set
I would like to know if I can open 2 different diagrams using MS
I would like to know which dependency described in my pom.xml brings a transitive
I would like to know what semaphores, messageQueues, etc... are active in my vxWorks
I would like to know what kind of tool you use for writing your

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.