jodd-core/src/main/java/jodd/util/StringUtil.java
public static String toUpperCase(final String s, Locale locale) {
		if (s == null) {
			return null;
		}

		StringBuilder sb = null;

		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);

			if (c > 127) {
				// found non-ascii char, fallback to the slow unicode detection

				if (locale == null) {
					locale = Locale.getDefault();
				}

				return s.toUpperCase(locale);
			}

			if ((c >= 'a') && (c <= 'z')) {
				if (sb == null) {
					sb = new StringBuilder(s);
				}

				sb.setCharAt(i, (char)(c - 32));
			}
		}

		if (sb == null) {
			return s;
		}

		return sb.toString();
	}
public static String toUpperCase(final String s, Locale locale) {
		if (s == null) {
			return null;
		}

		StringBuilder sb = null;

		for (int i = 0; i < s.length(); i++) {
			char c = s.charAt(i);

			if (c > 127) {
				// found non-ascii char, fallback to the slow unicode detection

				if (locale == null) {
					locale = Locale.getDefault();
				}

				return s.toUpperCase(locale);
			}

			if ((c >= 'a') && (c <= 'z')) {
				if (sb == null) {
					sb = new StringBuilder(s);
				}

				sb.setCharAt(i, (char)(c - 32));
			}
		}

		if (sb == null) {
			return s;
		}

		return sb.toString();
	}
public static String toUpperCase ( final String s , Locale locale ) { if ( s == null ) { return null ; } StringBuilder sb = null ; for ( int i = 0 ; i < s . length ( ) ; i ++ ) { char c = s . charAt ( i ) ; if ( c > 127 ) { // found non-ascii char, fallback to the slow unicode detection if ( locale == null ) { locale = Locale . getDefault ( ) ; } return s . toUpperCase ( locale ) ; } if ( ( c >= ' ' ) && ( c <= ' ' ) ) { if ( sb == null ) { sb = new StringBuilder ( s ) ; } sb . setCharAt ( i , ( char ) ( c - 32 ) ) ; } } if ( sb == null ) { return s ; } return sb . toString ( ) ; }
Converts all of the characters in the string to upper case, based on the
locale.

@param  s the string to convert
@param  locale apply this locale's rules
@return the string, converted to upper case, or <code>null</code> if the
string is <code>null</code>
Converts all of the characters in the string to upper case based on the locale .