On Sun, Oct 5, 2025 at 2:52 PM Jim Hall <[email protected]> wrote: > > (replying under a new 'Subject' line so it's easier to find) > > On Sun, Oct 5, 2025 at 10:15 AM Fritz Mueller via Freedos-devel > <[email protected]> wrote: > > > > As it is a technical meeting today, here a question you could > > discuss about: > > > > In NLS Jerome changed Brazil from "ptbr" to "ptb" to use 8.3 > > (pt=portugal). In the meantime I noticed that several nls files > > only support 8.2! Simple test: copy e.g. find.pt to find.ptb, > > then set lang=ptb, run find /? and check if there is english > > text. As the keyboards already use "BR" for Brazil this would > > be a good ending for this. Could you please discuss about this? > > We talked about it online today. It was a good opportunity for live debugging. > > The short version is that this is a limitation built into the Kitten > language library. I think it may go back to my original Catgets > library, but I didn't go back that far. > > For example, here's the Kitten that's included in FIND: > > https://gitlab.com/FreeDOS/base/find/-/blob/master/SOURCE/FIND/KITTEN.C > > > On line 159, the 'catlang' string variable is set to 3 (that's enough > room for 2 characters plus the null terminator). > > A little further down, Kitten gets the value of the LANG environment > variable, and fails if the LANG is not exactly 2 characters long. But > it succeeds if LANG is longer than 2, and the third character is a > hyphen (that's to accommodate language variations like "en-us" for US > English and "en-uk" for British English .. and so on for other > regional language variations). > > > /* We will need the value of LANG, and may need a 2-letter abbrev of > > LANG later on, so get it now. */ > > > > lang = getenv ("LANG"); > > > > if (lang == NULL) { > > /* printf("no lang= found\n"); */ /* not fatal, though */ > > /* Return failure - we won't be able to locate the cat file */ > > return (-1); > > } > > > > if ( ( strlen(lang) < 2 ) || > > ( (strlen(lang) > 2) && (lang[2] != '-') ) ) { > > /* Return failure - we won't be able to locate the cat file */ > > return (-1); > > } > > > > memcpy(catlang, lang, 2); > > /* we copy the full LANG value or the part before "-" if "-" found */ > > catlang[2] = '\0'; > [..] > > **I'll reply in a separate email with comments about fixes
**Here is my reply about fixes: I believe the original issue is that Portuguese and Brazilian Portuguese are different language variations. I know code page 860 is Portuguese. Is there a different code page for Brazilian Portuguese? If the language variations are not significant (for example, differences in US English and British English are usually easily understood .. like "sweater" in the US is a "jumper" in the UK) *and* if Portuguese and Brazilian Portuguese use the same code page, then I think the solution is to use PT for the 2-letter language code for both. If the language variations are significant (I am not familiar enough with Portuguese to know) *or* if Portuguese and Brazilian Portuguese use different code pages, then we'll need to apply a fix. A long-term fix is for Kitten to recognize 3-letter language codes, to support examples like PTB for Brazilian Portuguese. Note that "PTB" is not an ISO language code; I don't know of a separate 3-letter code for Brazilian Portuguese. Making this fix requires updating Kitten and then asking every developer to recompile a new version of their program using the new Kitten. Note that there are 2 versions of "Kitten." The version that you link with as a library is the "original" Kitten: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/devel/libs/kitten/kitten-src/ The other version is basically a "Kitten compiler" called KITTENC that attaches language resources to the executable program: https://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/devel/libs/kitten/kittenc/ **For those interested, I'll write a brief history of Kitten in another email reply. _______________________________________________ Freedos-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/freedos-devel
