Changeset 26086 for main/trunk/greenstone3
- Timestamp:
- 2012-08-09T11:08:41+12:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/src/java/org/greenstone/gsdl3/util/XSLTUtil.java
r25858 r26086 121 121 } 122 122 123 /* some preprocessing functions */124 public static String toLower(String orig)125 {126 return orig.toLowerCase();127 }128 129 public static String toUpper(String orig)130 {131 return orig.toUpperCase();132 }133 134 public static byte[] toUTF8(String orig)135 {136 try137 {138 byte[] utf8 = orig.getBytes("UTF-8");139 return utf8;140 }141 catch (Exception e)142 {143 logger.error("unsupported encoding");144 return orig.getBytes();145 }146 }147 123 148 124 public static String replace(String orig, String match, String replacement) … … 325 301 } 326 302 303 // formatting /preprocessing functions 304 // some require a language, so we'll have a language param for all 305 public static String toLower(String orig, String lang) 306 { 307 return orig.toLowerCase(); 308 } 309 310 public static String toUpper(String orig, String lang) 311 { 312 return orig.toUpperCase(); 313 } 314 315 public static byte[] toUTF8(String orig, String lang) 316 { 317 try 318 { 319 byte[] utf8 = orig.getBytes("UTF-8"); 320 return utf8; 321 } 322 catch (Exception e) 323 { 324 logger.error("unsupported encoding"); 325 return orig.getBytes(); 326 } 327 } 328 327 329 public static String formatDate(String date, String lang) 328 330 { … … 364 366 } 365 367 366 public static String formatBigNumber(String num )368 public static String formatBigNumber(String num, String lang) 367 369 { 368 370
Note:
See TracChangeset
for help on using the changeset viewer.