Jump to content


What should I set P4CHARSET to when using Visual Studio p4vs plug-in ?

p4vs P4CHARSET Visual Studio

  • Please log in to reply
1 reply to this topic

#1 gsb

gsb

    Advanced Member

  • Members
  • PipPipPip
  • 30 posts

Posted 26 July 2013 - 03:20 PM

I'm using Visual Studio 2010 with the p4vs 2013.2 plug-in and p4v client 2013.1/611291.  Our Perforce server is unicode enabled.   I notice that Visual Studio saves *.vcxproj and other project-related files in "UTF8 with signature (BOM)" format where it prepends BOM chars  at the start of the file.   Some of our *.cpp source code files have extended characters like French or Chinese chars in string literals.  When these files are auto-added to Perforce control they're set with filetype = <utf16>.  Occasionally, our users will some how manage to corrupt and submit these project files such that later on other users open the solution in Visual Studio and get errors loading projects like this:

"Unable to read the project file"myProject.csproj".  The project file could not be loaded.  The root element is missing."
or
hexadecimal value 0x1F, is an invalid character. Line 1, position 1.

Q:  What should I set P4CHARSET to ?  From the perforce doc, seems my choices are:

Unicode Client Byte-Order-Mark
P4CHARSET Unicode written to
settings Format files
------------------------------------------------------------------
utf8 UTF-8 No
utf8-bom UTF-8 Yes
utf8unchecked UTF-8 (not validated) No
utf8unchecked-bom UTF-8 (not validated) Yes
utf16 UTF-16 in client byte order Yes
utf16le UTF-16 in Little Endian order Yes (Windows Style)
utf16be UTF-16 in Big Endian order Yes
utf16-nobom UTF-16 in client byte order No
utf16le-nobom UTF-16 in Little Endian order No
utf16be-nobom UTF-16 in Big Endian order No
utf32 UTF-32 in client byte order Yes
utf32le UTF-32 in Little Endian order Yes
utf32be UTF-32 in Big Endian order Yes
utf32-nobom UTF-32 in client byte order No
utf32le-nobom UTF-32 in Little Endian order No
utf32be-nobom UTF-32 in Big Endian order No

Thanks for advice/comments.
-Greg

#2 P4Matt

P4Matt

    Advanced Member

  • Members
  • PipPipPip
  • 1383 posts

Posted 29 July 2013 - 08:17 PM

Your charset usually reflects the language you are using for your OS; for example many Japanese Windows users would use SHIFT-JIS; for a European system you generally use winansi.

For the project related files it may make more sense to store them as binary files if they do not match up with either the local character set or utf-16.





Also tagged with one or more of these keywords: p4vs P4CHARSET, Visual Studio

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users