Int 2F Fn 1401 CU - Nlsfunc.com - Change Code Page [U]

AX = 1401h
DS:SI -> internal code page structure (see #2305)
BX = new code page (see #1446 at INT 21/AX=6602h)
DX = country code???

Return: AL = status
00h successful
else DOS error code

Note: this function is called by the DOS v3.3+ kernel

See Also: AX=1400h"NLSFUNC",AX=1402h"NLSFUNC",INT 21/AH=66h

Format of DOS 3.30 internal code page structure:
Offset Size Description (Table 2305)
00h 8 BYTEs ???
08h 64 BYTEs name of country information file (see #2306)
48h WORD system code page (see #1446 at INT 21/AX=6602h)
4Ah WORD number of supported subfunctions
4Ch 5 BYTEs data to return for INT 21/AX=6502h
51h 5 BYTEs data to return for INT 21/AX=6504h
56h 5 BYTEs data to return for INT 21/AX=6505h
5Bh 5 BYTEs data to return for INT 21/AX=6506h
60h 41 BYTEs data to return for INT 21/AX=6501h

Format of MS-DOS/PC-DOS/OS2/WinNT/PTS-DOS COUNTRY.SYS file:
Offset Size Description (Table 2306)
00h BYTE ID tag (FFh)
01h 7 BYTEs ASCII "COUNTRY"
08h 8 BYTEs ??? (00h)
10h BYTE ??? (01h)
11h BYTE ??? (00h)
12h BYTE ??? (01h)
13h DWORD offset of first entry in file (see #2307)

See Also: #2310

Format of MS-DOS/PC-DOS/OS2/WinNT/PTS-DOS COUNTRY.SYS entry:
Offset Size Description (Table 2307)
00h WORD number of country-codepage entries following
02h N Country-Codepage entries:
Offset Size Description
00h WORD length of entry, not counting this word (000Ch)
02h WORD country ID
04h WORD codepage ID
06h WORD ??? (0000h)
08h WORD ??? (0000h)
0Ah DWORD offset of country-subfunction-header in file
(see #2308)

Notes: multiple codepages for a country are stored consecutively
PTS/DOS places a copyright string immediately following this structure,
though a copyright at the end of the file is preferable

See Also: #2306

Format of MS-DOS/PC-DOS/OS2/WinNT/PTS-DOS COUNTRY.SYS country-subfunc header:
Offset Size Description (Table 2308)
00h WORD number of subfunction entries following
02h N subfunction entries
Offset Size Description
00h WORD length of subfunction entry, not counting this
word (usually 06h)
02h WORD subfunction ID
(value passed to INT 21/AH=65h in AL)
04h DWORD offset within file of subfunction data entry
(see #2309)

See Also: #2307

Format of MS-DOS/PC-DOS/OS2/WinNT/PTS-DOS COUNTRY.SYS country-subfunc data::
Offset Size Description (Table 2309)
00h BYTE ID-tag (FFh)
01h 7 BYTEs table-type signature (blank-padded)
"CTYINFO" general country info (subfn 01h)
"UCASE " uppercase table (subfn 02h)
"LCASE " lowercase table (subfn 03h) (DOS 6.2_)
"FUCASE " filename uppercase table (subfn 04h)
"FCHAR " filename terminator table (subfn 05h)
"COLLATE" collating sequence (subfn 06h)
"DBCS " double-byte character table (subfn 07h)
08h WORD length of following table in bytes
(if 0000h for DBCS table, there will still be a word of 0000h)
---country info (01h)---
0Ah WORD country ID (see #1088 at AH=38h)
0Ch WORD code page (see #1446)
0Eh 34 BYTEs country-dependent info (see #1087 at AH=38h)
---uppercase table (02h)---
0Ah 128 BYTEs uppercase equivalents (if any) of chars 80h to FFh
---lowercase table (03h)---
0Ah 256 BYTEs lowercase equivalents (if any) of chars 00h to FFh
---filename uppercase table (04h)---
0Ah 128 BYTEs uppercase equivalents (if any) of chars 80h to FFh
---filename terminator table (05h)---
0Ah BYTE ??? (01h for MS-DOS 3.30-6.00)
0Bh BYTE lowest permissible character value for filename
0Ch BYTE highest permissible character value for filename
0Dh BYTE ??? (00h for MS-DOS 3.30-6.00)
0Eh BYTE first excluded character in range \ all characters in this
0Fh BYTE last excluded character in range / range are illegal
10h BYTE ??? (02h for MS-DOS 3.30-6.00)
11h BYTE number of illegal (terminator) characters
12h N BYTEs characters which terminate a filename: ."/\[]:|<>+=;,
---collating sequence (06h)---
0Ah 256 BYTEs values used to sort characters 00h to FFh
---DBCS table (07h)---
0Ah 2N BYTEs start/end for N lead byte ranges
WORD 0000h (end of table)

See Also: #2308,#1439,#1440,#1442,#1443,#1444,#1445

Format of DR DOS/Novell DOS/OpenDOS COUNTRY.SYS file:
Offset Size Description (Table 2310)
00h 126 BYTEs copyright notice (terminated with Ctrl-Z; NUL-padded)
the copyright notice starts with the signature
"COUNTRY.SYS Rx.xx" where "x.xx" indicates the file format
revision, which is checked by the OS (revision is 2.00 for
DR DOS 3.41 and 2.01 for all newer versions of DR DOS,
Novell DOS, and OpenDOS)
7Eh WORD signature of file format revision
0EDCh = 2.00 (DR DOS 3.41)
EDC1h = 2.01 (all newer versions)
80h var country pointer records (see #2311)
(packed array of variable-size records)

See Also: #2306

Format of DR DOS/Novell DOS/OpenDOS COUNTRY.SYS country pointer record::
Offset Size Description (Table 2311)
00h WORD country code (0000h if end of array)
02h WORD code page (see #1446)
04h WORD ??? (0000h)
06h 7 WORDs offsets in file for INT 21/AH=65h subfunctions 01h to 07h, or
0000h if no table for that subfunction
14h var country information

Notes: the end-of-file marker is a country pointer record filled entirely with
zeros
the data at which the pointers point is in the same format as the
tables returned by INT 21/AH=65h, except that the general-info
table for subfunction 01h does not contain the length word at the
beginning

See Also: #2310