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

  • SEARCH
  • Home
  • 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 6531009
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:49:33+00:00 2026-05-25T09:49:33+00:00

$node querystring = require(‘querystring’) var dict = { ‘q’: ‘what\’s up’ }; var url

  • 0
$node
querystring = require('querystring')
var dict = { 'q': 'what\'s up' };
var url = 'http://google.com/?q=' + querystring.stringify(dict);
url = encodeURIComponent(url);
console.log(url);

The result is this:

"http://google.com/?q=q=what's%20up"

Notice how the single quote is not encoded correctly. Is there something wrong with the node.js module?

  • 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-25T09:49:34+00:00Added an answer on May 25, 2026 at 9:49 am

    it is encoded correctly, if you type the same query into google sear field manually you will get this address:

    http://www.google.cz/#hl=cs&cp=8&gs_id=u&xhr=t&q=what's+up&pf=p&sclient=psy&site=&source=hp&pbx=1&oq=what's+u&aq=0&aqi=g5&aql=&gs_sm=&gs_upl=&bav=on.2,or.r_gc.r_pw.&fp=792ecf51920895b2&biw=1276&bih=683
    

    note that &q=what's+up& part

    and encodeURIComponent is not a Node.js module, but part of standard javascript library

    https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeURIComponent

    manual workaround:

    $node
    querystring = require('querystring')
    var dict = { 'q': 'what\'s up' };
    var url = 'http://google.com/?q=' + querystring.stringify(dict);
    url = encodeURIComponent(url);
    url = url.replace(/'/g,"%27");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using Node.js : var s = 'Who\'s that girl?'; var url = 'http://graph.facebook.com/?text='
In node.js you can use console.log or sys.puts to print out to the screen.
Node's HTTP module is not returning all the expected data from this URL: http://itradedata.co.za/pmchart/prices/GetPricesTRI.asp?Shortname=ACE&numprices=5
In Node.js I can use a module like this: sys = require(sys); How do
Can an ArrayList of Node contain a non-Node type? Is there a very dirty
void addNewNode (struct node *head, int n) { struct node* temp = (struct node*)
Duplicate Of : Find node clicked under context menu I've got a context menu
I've got a node struct struct Node{CString text, int id;}; in a sorted vector.
After a node's label is edited in the tree I try to resort the
With my current node selected I wish to find an element <name> [./name] and

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.