Hi John,
 
I was going to send a message to go with the fallback approach, so thanks for adding that.  However, typically we define such functions in php_api with a wrapping if ( !function_exists('mb_strlower') ) put such files in php_api.php.
 
We may want to add a check in check.php which warns the user when such functions are not available, since this would break multi-byte languages.
On Tue, Dec 9, 2008 at 10:03 AM, <git@mantisbt.org> wrote:
The branch, master has been updated
      via  c675a0180a7e65be2bf604bdcabc0e9f6cd3b6c7 (commit)
     from  4826187f8db2206ed0802a7b9c3eee1c14b2f2fb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit c675a0180a7e65be2bf604bdcabc0e9f6cd3b6c7
Author: John Reese <jreese@leetcode.net>
Date:   Tue Dec 9 13:03:22 2008 -0500

   Define string_lower() as a function that will use mb_strlower() if available, and fall back to strtolower() if not.
   Update install_category_migrate() to use the new function; affects #9161, 9298.

-----------------------------------------------------------------------

Summary of changes:
 admin/install_functions.php |    2 +-
 core/string_api.php         |   16 ++++++++++++++++
 2 files changed, 17 insertions(+), 1 deletions(-)

-----------------------------------------------------------------------

commit c675a0180a7e65be2bf604bdcabc0e9f6cd3b6c7
Author: John Reese <jreese@leetcode.net>
Date:   Tue Dec 9 13:03:22 2008 -0500

   Define string_lower() as a function that will use mb_strlower() if available, and fall back to strtolower() if not.
   Update install_category_migrate() to use the new function; affects #9161, 9298.

diff --git a/admin/install_functions.php b/admin/install_functions.php
index e535b97..44a263f 100644
--- a/admin/install_functions.php
+++ b/admin/install_functions.php
@@ -58,7 +58,7 @@ function install_category_migrate() {
       foreach( $t_data as $t_project_id => $t_categories ) {
               $t_inserted = array();
               foreach( $t_categories as $t_name => $t_true ) {
-                       $t_lower_name = strtolower( $t_name );
+                       $t_lower_name = string_lower( $t_name );
                       if ( !isset( $t_inserted[$t_lower_name] ) ) {
                               $query = "INSERT INTO $t_category_table ( name, project_id ) VALUES ( " . db_param() . ', ' . db_param() . ' )';
                               db_query_bound( $query, array( $t_name, $t_project_id ) );
diff --git a/core/string_api.php b/core/string_api.php
index ebf9006..6f82a41 100644
--- a/core/string_api.php
+++ b/core/string_api.php
@@ -37,6 +37,22 @@ require_once( $t_core_dir . 'user_pref_api.php' );
 $g_cache_html_valid_tags = '';
 $g_cache_html_valid_tags_single_line = '';

+/**
+ * Return a string with all alphabetical characters converted to lowercase,
+ * using an appropriate multibyte implementation as available to system.
+ * @param string Input string
+ * @return string Lower cased string
+ */
+if ( function_exists( 'mb_strtolower' ) ) {
+       function string_lower( $p_string ) {
+                       return mb_strtolower( $p_string );
+       }
+} else {
+       function string_lower( $p_string ) {
+                       return strtolower( $p_string );
+       }
+}
+
 # ## --------------------
 # Preserve spaces at beginning of lines.
 # Lines must be separated by \n rather than <br />

-----------------------------------------------------------------------


--
Mantis Bug Tracker

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
mantisbt-cvs mailing list
mantisbt-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mantisbt-cvs