HttpClient要求URL文字セットトランスコード問題


問題はこうです.私はeclipseでhttpclientリクエストを送信して以下のように問題ありませんが、ideaでは400を返します.毛は??excuse me?
package com.vol.timingTasks;


import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

/**
 *        
 *
 * @author xbx
 *
 */
public class XBXmain {
    private final static String ENCODE = "utf-8";

    public static void main(String[] args) throws Exception {
		getDataA();
    }


    /*
     * Basic  
     *    :
     *   :
     */
    public static void getDataA() throws  Exception{
        HttpResponse httpResponse = null;
        HttpClient httpClient = new DefaultHttpClient();
        String projectName = "           (  )";
        String url = "http://labour.ztjs.cn/clound/wsForThird/laboursByProjectName/"+projectName ;
        HttpGet get = new HttpGet(url);
        try {

            //   HttpClientBuilder
            HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
            //   BasicAuth
            CredentialsProvider provider = new BasicCredentialsProvider();
            // Create the authentication scope
            AuthScope scope = new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM);
            // Create credential pair,           
            UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("", "");
            // Inject the credentials
            provider.setCredentials(scope, credentials);
            // Set the default credentials provider
            httpClientBuilder.setDefaultCredentialsProvider(provider);
            // HttpClient
            CloseableHttpClient closeableHttpClient = httpClientBuilder.build();


            httpResponse = closeableHttpClient.execute(get);
            HttpEntity httpEntity = httpResponse.getEntity();
            String httpResult = EntityUtils.toString(httpEntity);
            String httpResult2 = EntityUtils.toString(httpEntity);
        } catch (IOException e) {
        }

    }



}

アクセス先:http://labour.ztjs.cn/clound/wsForThird/laboursByProjectName/中科洛陽情報産業園プロジェクト(一期)
Googleブラウザに置いてからコピーすると、漢字の符号化フォーマットが変わっています.OK、じゃ、まず符号化フォーマットを変換してからリクエストを送信します.修正後のコードは次のとおりです.
package com.vol.timingTasks;


import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.util.EntityUtils;

import java.io.IOException;

/**
 *        
 *
 * @author xbx
 *
 */
public class XBXmain {
    private final static String ENCODE = "utf-8";

    public static void main(String[] args) throws Exception {
		getDataA();
    }


    /*
     * Basic  
     *    :
     *   :
     */
    public static void getDataA() throws  Exception{
        HttpResponse httpResponse = null;
        HttpClient httpClient = new DefaultHttpClient();
        String projectName = "           (  )";
        String url = "http://labour.ztjs.cn/clound/wsForThird/laboursByProjectName/"+java.net.URLEncoder.encode(projectName, ENCODE);//URL       
        HttpGet get = new HttpGet(url);
        try {

            //   HttpClientBuilder
            HttpClientBuilder httpClientBuilder = HttpClientBuilder.create();
            //   BasicAuth
            CredentialsProvider provider = new BasicCredentialsProvider();
            // Create the authentication scope
            AuthScope scope = new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT, AuthScope.ANY_REALM);
            // Create credential pair,           
            UsernamePasswordCredentials credentials = new UsernamePasswordCredentials("", "");
            // Inject the credentials
            provider.setCredentials(scope, credentials);
            // Set the default credentials provider
            httpClientBuilder.setDefaultCredentialsProvider(provider);
            // HttpClient
            CloseableHttpClient closeableHttpClient = httpClientBuilder.build();


            httpResponse = closeableHttpClient.execute(get);
            HttpEntity httpEntity = httpResponse.getEntity();
            String httpResult = EntityUtils.toString(httpEntity);
            String httpResult2 = EntityUtils.toString(httpEntity);
        } catch (IOException e) {
        }

    }



}

もう一度やってみてください.要求は成功しました.コードを転送するだけです.
String url = "http://labour.ztjs.cn/clound/wsForThird/laboursByProjectName/「+java.net.URLEncoder.encode(projectName,ENCODE);//URL中国語トランスコード