I'd like to know more about the impact of Perforce's filetypes out of technical interest, rather than needing to solve a particular problem. (But it may save me headaches later when diagnosing issues!) Not sure how to express it other than questions about hypothetical bad practices, so here goes:
1. How should I store UTF-8 text files in Perforce?
My understanding is that Perforce's UTF-8 provision is the 'unicode' filetype. This filetype isn't enabled on my server and I'll assume it's not going to change.
If I choose 'binary' then that will be fine, until a client syncs to it with different OS line ending expectations?
2. Why do (some?) UTF-8 text files 'survive' being stored under the 'text' filetype?
- Download the attached utf8_as_text_filetype_text.txt (Content generated from http://generator.lor....info/_japanese)
- Submit it with the 'text' filetype
- Make a local copy
- Force sync
- Observe both the local and re-synced files are binary-identical
When will be the point when a UTF-8 text file is corrupted due to being stored as 'text'? Could I have a concrete example?
3. At what point does the 'text' filetype break down for arbitrary binary data?
I've experienced images corrupted because they were somehow ended up with the 'text' filetype, but I am curious to exactly why that happened.
I know that Perforce translates the line endings for us, but thought it's a moot point if the submitted and syncing clients are of the same OS.
If it's anything to do with deltas, then is 'text' guaranteed to work at least for just the initial 'add'?
Thanks very much!