Google Places Map <% request.setCharacterEncoding("UTF-8"); String q = request.getParameter("q"); String lat = request.getParameter("lat"); String lng = request.getParameter("lng"); 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; } %>