"php - convert string to unicode" Code Answer

1

"unicode" is not a real encoding; it's the name of the overarching standard and used as an alias for utf-16be mostly by microsoft, and apparently php supports it for that reason. what you expect is utf-16le, so use that explicitly:

$source = mb_convert_encoding('test', 'utf-16le', 'utf-8');
By Willo van der Merwe on September 23 2022

Answers related to “php - convert string to unicode”

Only authorized users can answer the Search term. Please sign in first, or register a free account.