Why not
```c++
return base::FilePath::FromUTF8Unsafe(icon_name).Extension();
```