Helix Core is now P4. Product user interfaces will be updated soon. Learn more >>

P4 CLI Documentation | 2025.2

# P4 Server file type detection and Unicode

In both Unicode mode and non-Unicode mode, if you do not assign a file type when you add a file to the depot, P4 Server (by default) attempts to detect file type by scanning the first 65536 characters of the file. If non-printable characters are detected, the file is assigned the `binary` file type. (In Unicode mode, a further check is performed: if there are no non-printable characters, and there are high-ASCII characters that are translatable using the character set specified by `P4CHARSET`, the file is assigned the `unicode` file type.)

Finally (for services running in Unicode mode or non-Unicode mode), if a UTF-16 BOM is present, the file is assigned the `utf16` file type. Otherwise, the file is assigned the `text` file type. (In Unicode mode, a further check is performed: files with high-ASCII characters that are undefined in the character set specified by `P4CHARSET` are assigned the `binary` file type.)

In most cases, there is no need to override P4 Server’s default file type detection. If you must override P4 Server’s default file type detection, you can assign P4 Server file types according to a file’s extension, by issuing the `p4 typemap` command. For more about using the typemap feature, refer to the P4 Server Administration Documentation, and the P4 CLI Reference.

Your search for returned results