Zend Framework

Zend_Filter_Input_StringToUpper and _StringToLower do not convert accented characters

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Not an Issue
  • Affects Version/s: 1.10.4
  • Fix Version/s: 1.10.5
  • Component/s: Zend_Filter
  • Labels:
    None

Description

I give a simple example of Portuguese. The word for action is "ação".

When I create a filter with Zend_Filter_StringToUpper() and call method filter for argument "ação", the result is "AçãO".
When I create a filter with Zend_Filter_StringToLower() and call method filter for argument "AÇÃO", the result is "aÇÃo".

I think that this problem is equally inconvenient to speakers (and writers) of French and German, and others whose languages uses accents.

The filter must convert accent characters too.

I tried to use setlocale(LC_ALL,"pt-BR"); before filter, but nothing has changed.

I am using PHP 5.2.

Activity

Hide
Thomas Weidner added a comment -

For me both filters are working also on german umlauts or accedent characters. This is even unittested.

Can you give an reproduceable example of your problem?

Show
Thomas Weidner added a comment - For me both filters are working also on german umlauts or accedent characters. This is even unittested. Can you give an reproduceable example of your problem?
Hide
Ramon Henrique Ornelas added a comment -

@Flavio

Try assign encoding.

$filter = new Zend_Filter_StringToUpper('UTF-8');
echo $filter->filter('ação');
Show
Ramon Henrique Ornelas added a comment - @Flavio Try assign encoding.
$filter = new Zend_Filter_StringToUpper('UTF-8');
echo $filter->filter('ação');
Hide
Flávio Gomes da Silva Lisboa added a comment -

Aswering to Thomas Weidner, the example can be made into an indexAction() so:

public function indexAction()

{ $filter = new Zend_Filter_StringToUpper(); echo $filter->filter('ação'); exit; }

The response will be "AçãO".

However, I follow the guideline of Ramon Henrique Ornelas and change the code to:

public function indexAction()

{ $filter = new Zend_Filter_StringToUpper('UTF-8'); echo $filter->filter('ação'); exit; }

Setting the encoding of browser to UTF-8, the response was "AÇÃO".

So... that is not a bug... excuse me, and thank you at same time.

Show
Flávio Gomes da Silva Lisboa added a comment - Aswering to Thomas Weidner, the example can be made into an indexAction() so: public function indexAction() { $filter = new Zend_Filter_StringToUpper(); echo $filter->filter('ação'); exit; } The response will be "AçãO". However, I follow the guideline of Ramon Henrique Ornelas and change the code to: public function indexAction() { $filter = new Zend_Filter_StringToUpper('UTF-8'); echo $filter->filter('ação'); exit; } Setting the encoding of browser to UTF-8, the response was "AÇÃO". So... that is not a bug... excuse me, and thank you at same time.
Hide
Thomas Weidner added a comment -

Closing as non-issue

Show
Thomas Weidner added a comment - Closing as non-issue

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: