Menu

Support Chinese Character

2006-07-05
2013-03-21
  • Zhang Minfeng

    Zhang Minfeng - 2006-07-05

    modify class.smarttemplateparser.php as follow can add support for Chinese Character

    // Replace Scalars
           
    // Support Chinese Character. by afeng

    // if (preg_match_all('/{([a-zA-Z0-9_. >]+)}/', $page, $var))
               
    if (preg_match_all('/{((?:(?:[\x81-\xfe].)|(?:[a-zA-Z0-9_. >]))+)}/', $page, $var))

     
    • EndelWar

      EndelWar - 2006-07-15

      Hi and thanks for writing.
      looking at your patch you are asking to support chinese char in variable name enclosed in brachets, right?
      I agree to expand the namespace of variables name in template, but matching the following regular expression:
      '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*' (if you ask why read this http://it2.php.net/language.variables\).

      Is this enough to support chinese charset?

       

Log in to post a comment.

MongoDB Logo MongoDB