<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%! String strip(String s) { if (s==null) return null; if (s.endsWith("/")) { if (s.length()==1) return ""; else return s.substring(0,s.length()-1); } else return s; } String decode(String _q) { String q = _q; if (q==null) q=""; else { char aC; String buffer = ""; int bP, sumb = 0; for (int i = 0, more = -1; i < q.length(); i++) { aC = q.charAt(i); switch (aC) { case'%': { aC = q.charAt(++i); int hb = (Character.isDigit(aC) ? aC - '0' : 10 + Character.toLowerCase(aC) - 'a') & 0xF; aC = q.charAt(++i); int lb = (Character.isDigit(aC) ? aC - '0' : 10 + Character.toLowerCase(aC) - 'a') & 0xF; bP = (hb << 4) | lb; break; } case'+': { bP = ' '; break; } default: { bP = aC; } } //* Decode byte bP as UTF-8, sumb collects incomplete chars *//* if ((bP & 0xc0) == 0x80) { // 10xxxxxx sumb = (sumb << 6) | (bP & 0x3f); if (--more == 0) buffer+=(char) sumb; } else if ((bP & 0x80) == 0x00) { // 0xxxxxxx buffer+=(char) bP; } else if ((bP & 0xe0) == 0xc0) { // 110xxxxx sumb = bP & 0x1f; more = 1; } else if ((bP & 0xf0) == 0xe0) { // 1110xxxx sumb = bP & 0x0f; more = 2; } else if ((bP & 0xf8) == 0xf0) { // 11110xxx sumb = bP & 0x07; more = 3; } else if ((bP & 0xfc) == 0xf8) { // 111110xx sumb = bP & 0x03; more = 4; } else { // 1111110x sumb = bP & 0x01; more = 5; } } q = buffer; } return q; } %> <% request.setCharacterEncoding("UTF-8"); String lat = request.getParameter("lat"), lng = request.getParameter("lng"), id = request.getParameter("id"), t = strip(decode(request.getParameter("t"))), sT = t; try { sT=java.net.URLEncoder.encode(t, "UTF-8"); } catch (Exception ex) { } String sUrl = "http://linkstore.ru/cforum/forum.jsp?id="+id+"&lat="+lat+"&lng="+lng+"&t="+sT; %> <%@ taglib uri="taglib355.tld" prefix="t" %> <%=sUrl%> <%=t%> <%=t%>
 
Map     Google     Bing     Yandex
 
Email   Facebook   Twitter
 
discussions powered by Disqus