Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 93984 invoked from network); 19 Jan 2006 16:45:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 19 Jan 2006 16:45:13 -0000 Received: (qmail 64976 invoked by uid 500); 19 Jan 2006 16:45:08 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 64914 invoked by uid 500); 19 Jan 2006 16:45:07 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 64899 invoked by uid 99); 19 Jan 2006 16:45:07 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jan 2006 08:45:07 -0800 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 5B2A6E0 for ; Thu, 19 Jan 2006 17:44:46 +0100 (CET) Message-ID: <104497988.1137689086370.JavaMail.jira@ajax.apache.org> Date: Thu, 19 Jan 2006 17:44:46 +0100 (CET) From: "Vladimir Strigun (JIRA)" To: harmony-dev@incubator.apache.org Subject: [jira] Commented: (HARMONY-24) java.net.URLEncoder.encode(String s, String enc) doesn't throw UnsupportedEncodingException In-Reply-To: <190711273.1135955163028.JavaMail.jira@ajax.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/HARMONY-24?page=comments#action_12363269 ] Vladimir Strigun commented on HARMONY-24: ----------------------------------------- Current implementation of encode(String, String) method use getBytes(encoding) method for encoding "special" characters. My testcase haven't some "special" characters, thatswhy we can't see exception. To fix it, we can add check that charset is supported: 19a20 > import java.nio.charset.Charset; 93a95,96 > if(!Charset.isSupported(enc)) > throw new UnsupportedEncodingException(enc); > java.net.URLEncoder.encode(String s, String enc) doesn't throw UnsupportedEncodingException > ------------------------------------------------------------------------------------------- > > Key: HARMONY-24 > URL: http://issues.apache.org/jira/browse/HARMONY-24 > Project: Harmony > Type: Bug > Components: Classlib > Reporter: Vladimir Strigun > Assignee: Geir Magnusson Jr > > Corresponding to API specification method encode(String, String) of java.net.URLEncoder should throw "UnsupportedEncodingException - If the named encoding is not supported". But the test shows that Harmony implementation doesn't throw an exception. > import java.io.UnsupportedEncodingException; > import java.net.URLEncoder; > public class Test { > public static void main(String[] args) { > try { > System.out.println("URLEncoder.encode="+URLEncoder.encode("str","unknown_enc")); > } catch (UnsupportedEncodingException e) { > e.printStackTrace(); > } > } > } -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira