@@ -268,9 +268,9 @@ fn check_posix_regex_errors(pattern: &str) -> ExprResult<()> {
268268/// Build a regex from a pattern string with locale-aware encoding
269269fn build_regex ( pattern_bytes : Vec < u8 > ) -> ExprResult < ( Regex , String ) > {
270270 use onig:: EncodedBytes ;
271- use uucore:: i18n:: { UEncoding , get_locale_encoding } ;
271+ use uucore:: i18n:: UEncoding ;
272272
273- let encoding = get_locale_encoding ( ) ;
273+ let encoding = uucore :: i18n :: get_locale_encoding ( ) ;
274274
275275 // For pattern processing, we need to handle it based on locale
276276 let pattern_str = String :: from_utf8 ( pattern_bytes. clone ( ) )
@@ -388,9 +388,9 @@ fn regex_search<T: onig::EncodedChars>(
388388/// Find matches in the input using the compiled regex
389389fn find_match ( regex : Regex , re_string : String , left_bytes : Vec < u8 > ) -> String {
390390 use onig:: EncodedBytes ;
391- use uucore:: i18n:: { UEncoding , get_locale_encoding } ;
391+ use uucore:: i18n:: UEncoding ;
392392
393- let encoding = get_locale_encoding ( ) ;
393+ let encoding = uucore :: i18n :: get_locale_encoding ( ) ;
394394
395395 // Match against the input using the appropriate encoding
396396 let mut region = onig:: Region :: new ( ) ;
@@ -506,11 +506,12 @@ fn find_match(regex: Regex, re_string: String, left_bytes: Vec<u8>) -> String {
506506
507507/// Evaluate a match expression with locale-aware regex matching
508508fn evaluate_match_expression ( left_bytes : Vec < u8 > , right_bytes : Vec < u8 > ) -> ExprResult < NumOrStr > {
509+ use uucore:: i18n:: UEncoding ;
510+
509511 let ( regex, re_string) = build_regex ( right_bytes) ?;
510512
511513 // Special case for ASCII locale with capture groups that need to return raw bytes
512- use uucore:: i18n:: { UEncoding , get_locale_encoding} ;
513- let encoding = get_locale_encoding ( ) ;
514+ let encoding = uucore:: i18n:: get_locale_encoding ( ) ;
514515
515516 if matches ! ( encoding, UEncoding :: Ascii ) && regex. captures_len ( ) > 0 {
516517 // Try to find the actual capture bytes for ASCII locale
0 commit comments