<p>This may be a bug, and is probably worth reporting to P&amp;T.</p>

<p>However, it's very difficult (if not impossible) for them to account for every potential ASCII character mapping for every possible language. For that reason, there is a <a href="https://craftcms.com/docs/config-settings#customAsciiCharMappings" rel="nofollow">customAsciiCharMappings</a> config setting, which you can use as a workaround.</p>

CC BY-SA 3.0
2016-06-30T22:31:50.737Z
Ok I'll report it. For now I just lowercase the string before passing it to the normalize method to get the correct result.
oncode
CC BY-SA 3.0
2016-06-30T17:08:20.283Z
2016-06-30T17:10:10.520Z
2016-06-30T17:10:10.520Z
Lindsey D
<p>The <code>StringHelper::normalizeKeywords()</code> doesn't work as I expected.</p>

<p>When I normalize <code>überblick</code> it leads to the expected result:</p>

<pre><code>StringHelper::normalizeKeywords('überblick') -&gt; ueberblick
</code></pre>

<p>But when I normalize <code>ÜBERBLICK</code> I expect it also to be <code>ueberblick</code> but it actually returns <code>überblick</code>.</p>

<p>It could be fixed by adding the missing ASCII mappings (e.g. 196 => 'Ae') to the <code>StringHelper::getAsciiCharMap()</code> method or converting the string to lowercase before replacing the characters in <code>StringHelper::normalizeKeywords()</code> on lines 358 - 362:</p>

<pre><code>-&gt; switch these two lines:

// Remove punctuation and diacritics
$str = strtr($str, static::_getCharMap());

// Normalize to lowercase
$str = StringHelper::toLowerCase($str);
</code></pre>

CC BY-SA 3.0
2016-06-30T16:53:07.373Z
This sounds like a bug... I'd recommend reporting this directly to support@craftcms.com
Lindsey D
<search><string>
Normalizing Keywords Bug
# Normalizing Keywords Bug

(Asked by: username_0 on 2016-06-30)

The StringHelper::normalizeKeywords() doesn't work as I expected.
When I normalize überblick it leads to the expected result:
StringHelper::normalizeKeywords('überblick') -> ueberblick

But when I normalize ÜBERBLICK I expect it also to be ueberblick but it actually returns überblick.
It could be fixed by adding the missing ASCII mappings (e.g. 196 => 'Ae') to the StringHelper::getAsciiCharMap() method or converting the string to lowercase before replacing the characters in StringHelper::normalizeKeywords() on lines 358 - 362:
-> switch these two lines:

// Remove punctuation and diacritics
$str = strtr($str, static::_getCharMap());

// Normalize to lowercase
$str = StringHelper::toLowerCase($str);

**Tags:** search, string
> **Comments:**
> **username_1**: This sounds like a bug... I'd recommend reporting this directly to support@craftcms.com  

---

## 1 answers

### Answer by username_1 on 2016-06-30. Score: 1 | Accepted answer

This may be a bug, and is probably worth reporting to P&T.

However, it's very difficult (if not impossible) for them to account for every potential ASCII character mapping for every possible language. For that reason, there is a [customAsciiCharMappings](https://craftcms.com/docs/config-settings#customAsciiCharMappings) config setting, which you can use as a workaround.

> **Comments:**
> **username_0**: Ok I'll report it. For now I just lowercase the string before passing it to the normalize method to get the correct result.  

---

