Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: java.net.IDN jar for JDK 1.5? Date: Wed, 27 Jul 2011 09:37:48 +0200 Organization: albasani.net Lines: 45 Message-ID: References: <4e2f3f6c$0$302$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 8bit X-Trace: news.albasani.net xcO85ZbhjkssjXiubDu2vvVCJeVTaUHHPDlq75OyDBht0RkgAI7mlx6Kqa5o3CIXFjGIrnjDbRTzxZ41bCFDN+7Gf6pHuOKGi7vyk8iOe3+cO4auKQfnmjlKr+NZH+Gw NNTP-Posting-Date: Wed, 27 Jul 2011 07:37:49 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="qBsGoq0paOu0FpZtcHkjg9OHKIxCmlaXq/vqewtC6TAvQeAaWmIxKBcajn8mhzjdwvWoZXkskDY+VvkjFNuh1le9TBPZoLf2wemkOONzwa3kZF2F40DC3xH7trN8lQqE"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110706 Firefox/5.0 SeaMonkey/2.2 In-Reply-To: <4e2f3f6c$0$302$14726298@news.sunsite.dk> Cancel-Lock: sha1:Mg4JScMb8BFDww4T6S+RLMNVpq4= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6608 Arne Vajhøj schrieb: > On 7/26/2011 6:24 AM, Jan Burse wrote: >> Just noticed that JDK 1.6 has the new class java.net.IDN, >> which provides Namerep and Punycode. >> >> Any .jar file around that can be used to add this >> functionality (this class) to JDK 1.5? > > GNU libidn has a Java implementation. > > Arne > > http://www.gnu.org/software/libidn/ They write: A native Java and C# port is included. Does it mean the Java lib just calls C? Or is it a pure Java implementation? I am thinking about bundling the jar with an applet, so when it uses some native component then it would be problematic. There is indeed some sun lib which has for example Punycode: package sun.net.idn; public final class Punycode; But using such libraries does not work, because for example an Oracle applet does bar the package sun.* from use in an applet. One will get an exception. Which makes sense, since different applet provides might have different internal libraries. I guess sun.net.idn is old, judging from the change log: http://www.docjar.com/html/api/sun/net/idn/Punycode.java.html Maybe there is a com.ibm.icu jar? Bye