Appendix A. SRI Encoding of Filenames

 

SFTP2, SCP2, SFTP2 server, and SCP server use SRI mapping to preserve case and characters that are not valid in filenames on OpenVMS ODS-2 disks.

OpenVMS disk filenames can be 39 characters long (as can file extensions) and include only the following characters: 0 through 9, A through Z, dollar sign ($), hyphen (-), and underscore (_).

The below table shows the default SRI International mapping.

ASCII character...

Is mapped to...

With octal value...

Ctrl/A (soh)

$4A

001

Ctrl/B (stx)

$4B

002

Ctrl/C (etx)

$4C

003

Ctrl/D (eot)

$4D

004

Ctrl/E (enq)

$4E

005

Ctrl/F (ack)

$4F

006

Ctrl/G (bel)

$4G

007

Ctrl/H (bs)

$4H

010

Ctrl/I (ht)

$4I

011

Ctrl/J (nl)

$4J

012

Ctrl/K (vt)

$4K

013

Ctrl/L (np)

$4L

014

Ctrl/M (cr)

$4M

015

Ctrl/N (so)

$4N

016

Ctrl/O (si)

$4O

017

Ctrl/P (dle)

$4P

020

Ctrl/Q (dc1)

$4Q

021

Ctrl/R (dc2)

$4R

022

Ctrl/S (dc3)

$4S

023

Ctrl/T (dc4)

$4T

024

Ctrl/U (nak)

$4U

025

Ctrl/V (syn)

$4V

026

Ctrl/W (etb)

$4W

027

Ctrl/X (can)

$4X

030

Ctrl/Y (em)

$4Y

031

Ctrl/Z (sub)

$4Z

032

Ctrl/[ (esc)

$6B

033

Ctrl/(fs)

$6C

034

Ctrl/] (gs)

$6D

035

Ctrl/^ (rs)

$6E

036     

Ctrl/_ (us)

$6F

037

SPACE (sp)

$7A

040

!

$5A

041

"

$5B

042

#

$5C

043

$

$$ (See Rule 8 in the following table.)

044

%

$5E

045

&

$5F

046

'

$5G

047

(

$5H

050

)

$5I

051

*

$5J

052

+

$5K

053

,

$5L

054

-

same

055

.

. or $5N (See the following table.)

056

/

not mapped (directory delimiter)

057

0 to 9

same

060 to 071

:

$5Z

072

;

$7B

073

$7C

074

=

$7D

075

$7E

076

?

$7F

077

@

$8A

100

A to Z

same

101 to 132

[

$8B

133

 

$8C

134

]

$8D

135

^

$8E

136

_

same

137

`

$9A

140

a to z

same

141 to 172

{

$9B

173

|

$9C

174

}

$9D

175

~

$9E

176

DEL

$9F

177

octal 200 to ¿

$200 to $277

200 to 277 (Multinational)

À to octal 377

$300 to $377

300 to 377 (Multinational)

 

 

The SRI mapping filename translation rules in the below table are based on the character mapping scheme from above.

Rule

What happens to filenames on OpenVMS...

1

Lowercase characters become uppercase (unless Rule 2 applies; see also Rule 3):

foobar.txt becomes FOOBAR.TXT;1

2

Initial uppercase characters or a sequence of case-shifted characters get a $ prefix:

CaseShiftedFile becomes $C$ASE$S$HIFTED$F$ILE.;1

3

An unversioned file gets a version number preceded by a semicolon:

foobar.txt becomes FOOBAR.TXT;1

4

If a filename does not include a file extension dot (.), it gets one before the version number semicolon:

foobar becomes FOOBAR.;1

5

The first dot in a filename is preserved, unless the result fails the 39-character extension limit test in Rule 5 (if so, the dot becomes $5N). Each successive dot becomes $5N, unless the filename exceeds the limits in Rule 5.

more.file.txt becomes MORE.FILE$5NTXT;1

6

If the filename is a directory name, each dot in it becomes $5N and the filename gets the .DIR extension:

dot.directory.list becomes DOT$5NDIRECTORY$5NLIST.DIR;1

7

Invalid OpenVMS characters become the escape character sequences in the second column of the above table ($ followed by a digit and a letter):

special#character&file becomes SPECIAL$5CCHARACTER$5FFILE.;1

(# becomes $5C and & becomes $5F)

8

Any existing $ becomes $$ (plus any $ added due to Rule 2 or 8 above):

dollar$Sign$5cfile becomes DOLLAR$$$S$IGN$$5CFILE.;1