Avoid deprecation warnings.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@1242 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
ray
2003-10-08 00:35:57 +00:00
parent c9239fd74a
commit efe326f8db
@@ -1,5 +1,5 @@
//
// $Id: StringTool.java,v 1.9 2003/10/06 22:49:57 ray Exp $
// $Id: StringTool.java,v 1.10 2003/10/08 00:35:57 ray Exp $
//
// samskivert library - useful routines for java programs
// Copyright (C) 2001 Michael Bayne
@@ -44,7 +44,12 @@ public class StringTool
*/
public static String urlEncode (String text)
{
return URLEncoder.encode(text);
try {
return URLEncoder.encode(text, "UTF-8");
} catch (java.io.UnsupportedEncodingException uee) {
// won't happen
return text;
}
}
/**