aspose file tools*
The moose likes General Computing and the fly likes Spaces in word Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "Spaces in word" Watch "Spaces in word" New topic
Author

Spaces in word

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 351
Hi,

I am trying to send a query to Google Analytics but when I send the word like "United Kingdom". Google launch an error because the blank space. I need send it as one unique word. Do you know any wrapper or something like that?.

Any idea?

Thanks
K. Tsang
Bartender

Joined: Sep 13, 2007
Posts: 2409
    
    7

How do the URLs with spaces work? They replace them with the hex equivalent of space I think.

I'm not sure about Google Analytics, you might want to check their docs.


K. Tsang JavaRanch SCJP5 SCJD/OCM-JD OCPJP7 OCPWCD5
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

You need to URL-encode values in URLs. The space will be turned into a +, or the hex equivalent.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 351
For example if my query contains:


country=="United Kingdom"


And after that I use;


URL optimizedQuery = new URL(query);

That's what I am doing what more I need, please?

Thanks
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

java.net.URLEncoder
varshika krish
Greenhorn

Joined: Dec 06, 2012
Posts: 5
i'm also try can not done it's may be Google Analytic
 
 
subject: Spaces in word