Fixes h() to not return empty string when input contains invalid code unit requence. Fixes #3561
Merge pull request #1085 from uzyn/bugfix/h-3.0-3561

Fixes h() to not return empty string when input contains invalid code unit sequence. 

Fixes #3561