Title: Uncaught ValueError: mb_regex_encoding()
Last modified: March 9, 2023

---

# Uncaught ValueError: mb_regex_encoding()

 *  Resolved [alamana](https://wordpress.org/support/users/alamana/)
 * (@alamana)
 * [3 years, 3 months ago](https://wordpress.org/support/topic/uncaught-valueerror-mb_regex_encoding/)
 * Any idea what may cause this issue? I found it in the logs:
 *     ```wp-block-code
       2023/01/31 00:07:35 [error] 1075#1075: *972 FastCGI sent in stderr: "PHP message: [CRITICAL] : Uncaught ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "Windows-1252" gi>
   
       Stack trace:
   
       #0 /var/www/example.org/htdocs/wp-content/plugins/gotmls/images/index.php(56): mb_regex_encoding()
   
       #1 /var/www/example.org/htdocs/wp-content/plugins/gotmls/images/index.php(1199): GOTMLS_load_contents()
   
       #2 /var/www/example.org/htdocs/wp-content/plugins/gotmls/images/index.php(1822): GOTMLS_scanfile()
   
       #3 /var/www/example.org/htdocs/wp-content/plugins/gotmls/images/index.php(1861): GOTMLS_check_file()
   
       #4 /var/www/example.org/htdocs/wp-content/plugins/gotmls/index.php(1624): GOTMLS_scandir()
   
       #5 /var/www/example.org/htdocs/wp-includes/class-wp-hook.php(308): GOTMLS_ajax_scan()
   
       #6 /var/www/example.org/htdocs/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters()
   
       #7 /var/www/example.org/htdocs/wp-includes/plugin.php(517): WP_Hook->do_action()
   
       #8 /var/www/" while reading upstream, client: 154.16.157.198, server: example.org, request: "GET /wp-admin/admin-ajax.php?action=GOTMLS_scan&GOTMLS_mt=feb499820a403fefedc4fc7e10ec8fe4&mt=1675112566.4113
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Eli](https://wordpress.org/support/users/scheeeli/)
 * (@scheeeli)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/uncaught-valueerror-mb_regex_encoding/#post-16547705)
 * Thanks so much for reporting this bug with enough detailed info that I could 
   find and fix the issue. I was actually quite surprised to discover that the PHP
   function mb_regex_encoding does not recognize Windows-1252 (or any other Windows
   encoding) as a valid encoding.
 * In any case, I have just release a new plugin update (version 4.21.92) which 
   fixes this PHP Error.
 * Thanks again for your help with this 😉
 *  Thread Starter [alamana](https://wordpress.org/support/users/alamana/)
 * (@alamana)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/uncaught-valueerror-mb_regex_encoding/#post-16550692)
 * Thanks for your great work and speedy reply!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Uncaught ValueError: mb_regex_encoding()’ is closed to new replies.

 * ![](https://ps.w.org/gotmls/assets/icon-256x256.png?rev=1001824)
 * [Anti-Malware Security and Brute-Force Firewall](https://wordpress.org/plugins/gotmls/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gotmls/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gotmls/)
 * [Active Topics](https://wordpress.org/support/plugin/gotmls/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gotmls/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gotmls/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [alamana](https://wordpress.org/support/users/alamana/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/uncaught-valueerror-mb_regex_encoding/#post-16550692)
 * Status: resolved