package com.palmnest.webapp.controller.wechat;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

public class Test {

	public static void main(String[] args) {
		try {
			String redirectUrl = "https://wcard.hstypay.com/getWelfare?spid=3000000210&attach={\"actionId\":\"10004\",\"sourceId\":\"0000013\"}";
			String url         = redirectUrl.substring(0, redirectUrl.indexOf("&attach=") + 8);
			String url1        = URLEncoder.encode(redirectUrl.substring(redirectUrl.indexOf("&attach=") + 8), "utf-8");
			System.out.println(url);
			System.out.println(url1);
			System.out.println(url + url1);
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
