Handle unicode literals properly in matrices

Fixes #7604