wood burning stoves 2.0*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 321
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: 1973
    
    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
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60072
    
  65

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: 321
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: 60072
    
  65

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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Spaces in word
 
Similar Threads
how to build java word wheel
Build Word Wheel in Java
Beta Part II submission acknowledgement
translate from English to Hindi
Matching pattern in given list