first commit

This commit is contained in:
2025-07-28 13:56:49 +05:30
commit e9eb805edb
3438 changed files with 520990 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
package net.sf.jasperreports.engine.util;
import java.util.Locale;
import java.util.TimeZone;
public class JRDataUtils {
public static String getLocaleCode(Locale locale) {
return locale.toString();
}
public static Locale getLocale(String code) {
String language, country, variant;
int firstSep = code.indexOf('_');
if (firstSep < 0) {
language = code;
country = variant = "";
} else {
language = code.substring(0, firstSep);
int secondSep = code.indexOf('_', firstSep + 1);
if (secondSep < 0) {
country = code.substring(firstSep + 1);
variant = "";
} else {
country = code.substring(firstSep + 1, secondSep);
variant = code.substring(secondSep + 1);
}
}
return new Locale(language, country, variant);
}
public static String getTimeZoneId(TimeZone tz) {
return tz.getID();
}
public static TimeZone getTimeZone(String id) {
return TimeZone.getTimeZone(id);
}
}