Re: [SMARTY-DEV] Special characters (such as umlauts) in variabes doesn't work!
| From: | Monte Ohrt | Date: | Mon, 16 Sep 2002 15:55:35 +0000 |
| Subject: | Re: [SMARTY-DEV] Special characters (such as umlauts) in variabes doesn't work! | ||
| References: | 1 | Groups: | php.smarty.dev |
| Request: | Send a blank email to php-smarty-dev+get-272@lists.php.net to get a copy of this message | ||
We basically use \w in our preg_expressions to match var names, so these chars fall outside of the boundary of \w. Does anyone know what would be a safe alternative to \w that covers these special chars?
Mattias Johansson wrote:
I've run into a little problem using Smarty, and I'm pretty darn sure it's a bug, so I'd thought I'd report it... Smarty won't print variables passed from PHP where the variable name contains characters such as å, ä, ö. It will simply regard them as non existent. A variable such as $näsa is perfectly valid in PHP, but doesn't work in Smarty - very annyoying. It will work fine in {if}s: {if $näsa == 5} Näsa is 5! {/if} but when you try to print it: {$näsa} - you get: Fatal error: Smarty plugin error: [in template.tpl line X]: unknown tag - '$näsa' in Smarty.class.php on line 1980 This is very annoying, since umlauted words (and therefore variables) are very common here in Europe. Is there any way to fix this easily? /mattias-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.