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 6180593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:52:17+00:00 2026-05-24T00:52:17+00:00

I am completely stuck on this one. I know my code is correct. It

  • 0

I am completely stuck on this one. I know my code is correct. It is very simple. I have tried comparing what to null, using .equals, and now .length(), but it keeps catching this exception. Does anyone know what is going on?

public static void findLocations(String what, String near, String near2, String type) {
    StringBuilder responseBuilder = new StringBuilder();
    try {
        URL url;
        String tempURL = "http://.........";

        if (what.length() != 0) { // This line is catching UnsupportedEncodingException
            tempURL += "&category=" + URLEncoder.encode(what, "UTF-8");
        }

        if (near.length() != 0) {


Thread [<1> main] (Suspended)   
LocationSet.findLocations(String, String, String, String) line: 85  
SearchAlgorithm.editNear() line: 322    
SearchAlgorithm.search(String, String) line: 90 
SearchView.onClick(View) line: 281  
Button(View).performClick() line: 2408  
View$PerformClick.run() line: 8816  
ViewRoot(Handler).handleCallback(Message) line: 587 
ViewRoot(Handler).dispatchMessage(Message) line: 92 
Looper.loop() line: 123 
ActivityThread.main(String[]) line: 4627    
Method.invokeNative(Object, Object[], Class, Class[], Class, int, boolean) line: not available [native method]  
Method.invoke(Object, Object...) line: 521  
ZygoteInit$MethodAndArgsCaller.run() line: 868  
ZygoteInit.main(String[]) line: 626 
NativeStart.main(String[]) line: not available [native method]  
  • 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-24T00:52:19+00:00Added an answer on May 24, 2026 at 12:52 am

    http://download.oracle.com/javase/1.4.2/docs/api/java/net/URLEncoder.html#encode%28java.lang.String,%20java.lang.String%29

    public static String encode(String s,
    String enc)
    throws UnsupportedEncodingException

    The methode “URLENCODER.encode(what, “UTF-8”) is the line, where you get the exception.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm sure I'm missing something very simple on this one. After banging my head
So I haven't been doing this for long but I'm completely stuck on this.
Ok, so i have got myself completely stuck. My search skill are lacking and
Right, I know I am totally going to look an idiot with this one,
I have an unusual case where I have a very simple Exception getting thrown
Take this code: using System; namespace OddThrow { class Program { static void Main(string[]
I post this here as a last resort. I'm completely stuck and do not
I have read that using command pattern is one of the most popular ways
I'm completely stuck and need your help... I've created a webservice stub with jaxb
I'm reading the not so complete pytz documentation and I'm stuck on understand one

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.