Jump to content


Retrieve file encoding using P4API.NET

File Encoding P4API.NET

  • Please log in to reply
2 replies to this topic

#1 Sarath Kumar Harikrishnan

Sarath Kumar Harikrishnan

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 17 June 2019 - 10:05 AM

Hi Team,

I'm trying to retrieve encoding of file (like UTF-8, UTF-8 BOM, UCS-2 LE etc) in perforce repository.

Tried using FileHistory class, but that gives only Perforce filetype.

My requirement is, without syncing the file from the repository, i should be able to retrieve file encoding information.

Please guide me on if i can get that information using P4API also i would welcome other possible options which i can try and get the encoding information.

Thanks,
Sarath

#2 p4rfong

p4rfong

    Advanced Member

  • Staff Moderators
  • 330 posts

Posted 26 June 2019 - 07:50 PM

Please post your question under the APIs topic.

#3 Sambwise

Sambwise

    Advanced Member

  • Members
  • PipPipPip
  • 846 posts

Posted 26 June 2019 - 09:26 PM

The server returns the charset from the "p4 fstat" command as "headCharset":

https://www.perforce...f/p4_fstat.html

This corresponds to the "FileMetadata" object in P4API.NET:

https://www.perforce...ileMetaData.htm

but there's no HeadCharset property in there, so there probably needs to be a change to P4API.NET to pipe it through.





Also tagged with one or more of these keywords: File Encoding, P4API.NET

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users