UTF16 File Type
SUMMARY
The Perforce utf16 file type was introduced in the 2007.2 version of the Perforce Server. The format that such files appear in your client workspace depends on the Perforce client version used to sync them and the byte order of your processor.
DETAILS
Client Version Dependencies
When Perforce type utf16 files are synced using a 2007.2 or later client, they are transferred to the client workspace in UTF-16 format. However, if such files are synced with 2007.1 or earlier clients, these file types ware transferred in UTF-8 format.In order to recreate Perforce type utf16 files in your client workspace in UTF-16 format, you must either:
- Upgrade your Perforce clients to 2007.2 or later, or
- When using a 2007.1 or earlier client, use a script or unicode editor to manually convert the workspace files from UTF-8 to UTF-16
Byte Order Marks (Endianness)
File byte order (endianness) is determined by the computer processor
architecture. For example, Windows and Linux run on the x86
architecture, which uses a little-endian byte order.
When Perforce type utf16 files are written to a client workspace with the p4 sync command, these files are always written with a byte order mark (BOM) and using the endianness of the client machine. As a result, a file that was originally submitted as a utf16 file with a big-endian BOM is synced to any x86 client workspace using the machine's native little-endian format.
