users.dat Encoding format

Anonymous

users.dat Encoding format

Anonymous
Not applicable

Does anyone happen to know what the encoding format is for the users.dat file in the workshared project backup folder? I would like to use it to get a list of everyone who has worked on the project.  I can open it in notepad and see the list.  There is weird formatting.  Opening it in Code Writter has better formatting, but there is no spaces between users entries.

 

Thanks

0 Likes
Reply
Accepted solutions (1)
1,296 Views
5 Replies
Replies (5)

jeremytammik
Autodesk
Autodesk

Dear Michael,

Thank you for your query.

I cannot tell off-hand.

Can yu attach a sample file to explore, or would that divulge confidential info?

Best regards,

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

Anonymous
Not applicable

I have attached the file, as well as screen shots from Code Writter and Notepad

0 Likes

Anonymous
Not applicable
Accepted solution

I finally got back to this, and it is a string of escape characters. Sometimes the Users.dat file begins with "\f" sometimes "\r". There is always the null character "\0" in between every character. In between each user entry is a control character. Sometime it is "ACK" sometimes Device Control 1-4.

 

So it looks like the easiest way to get the user list is to parse out the special ascii characters and look for null and a control character next to each other as a break in between users.

jeremytammik
Autodesk
Autodesk

Have you tried to interpret this simply as a Unicode text file?

 

Here are my results opening it in a text editor on the Mac:

 

 users_dat_utf8.png

 

 

 

It looks like this in Visual Studio using automatic text encoding:

  users_dat_vs_auto.png

 

Cheers,

 

Jeremy

 

 

 

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

jeremytammik
Autodesk
Autodesk

Dear Michael,

 

Here is another suggestion:

 

https://www.crummy.com/software/BeautifulSoup/bs4/doc/#unicode-dammit

 

It is pointed at (along with many others) in the discussion on determining the encoding of text in Python:

 

https://stackoverflow.com/questions/436220/determine-the-encoding-of-text-in-python

 

I found that searching the Internet for 'python determine text encoding':

 

https://duckduckgo.com/?q=python+determine+text+encoding

 

... Later...

 

The encoding is indeed a bit hard to nail down.

 

I installed the Python charset project, which also installs a `chardetect` utility.

 

https://pypi.org/project/chardet

 

Running chardetect on users.dat simply reports:

  

 

$ chardetect users.dat
users.dat: ascii with confidence 1.0

   

Unfortunately, that is no big help.

 

Ah well, you seem to have it under control, anyway.

 

Cheers,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes