Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel reports "Space between value and currency symbol = NO" for Germany #5

Closed
bttrx opened this issue Dec 30, 2021 · 17 comments
Closed

Comments

@bttrx
Copy link

bttrx commented Dec 30, 2021

This is when you use "!COUNTRY=049" in FDCONFIG.SYS, so no COUNTRY.SYS is involved.

But the kernel should report "YES" like in

de_850 cnf 49,850,DMY,"E","U","R",0,0,".",",",".",":",3,2,_24; Germany Tom
.

So, please change "1 , 2,_TIME_24" in

{ 49,_DATE_DMY,"EUR" ,'.',',', '.',':', 1 , 2,_TIME_24},/* Germany */
to "3 , 2,_TIME_24" to fix this.

@bttrx bttrx changed the title Kernel reports "currency symbol follows value" = no for Germany Kernel reports "Space between value and currency symbol = NO" for Germany Dec 30, 2021
andrewbird added a commit to andrewbird/country that referenced this issue Dec 31, 2021
"Space between value and currency symbol = NO" for Germany but should be
yes.
andrewbird added a commit to andrewbird/country that referenced this issue Dec 31, 2021
"Space between value and currency symbol = NO" for Germany but should be
yes.
@andrewbird
Copy link
Contributor

You should be able to test the relevent kernel from here https://github.com/FDOS/kernel/actions/runs/1641887176
Thanks.

@bttrx
Copy link
Author

bttrx commented Jan 2, 2022

I tested both new kernels.
Country data is returned correctly, except it reports country code = 1 (USA), although I set "country=049" in config.sys.

This seems to be an old issues, because I also found this problem in FD 1.1 and FD 1.2 kernels.
Had a quick look at the code, but have no idea so far:
https://github.com/FDOS/kernel/blob/202e3c1c94dbc3c268865ba21d18ed71a95524f1/kernel/inthndlr.c#L882
https://github.com/FDOS/kernel/blob/202e3c1c94dbc3c268865ba21d18ed71a95524f1/kernel/nls.c#L611
https://github.com/FDOS/kernel/blob/master/docs/nls.txt

Maybe you can spot it.

@andrewbird
Copy link
Contributor

Hi Robert,
Thanks for the report and info. Could you tell me which function or tool is reporting the incorrect value, please?

@bttrx
Copy link
Author

bttrx commented Jan 2, 2022

@andrewbird
Copy link
Contributor

Here's what I see under dosemu2 using your test program, current git kernel/country.sys, current git freecom and just adding country=049 to fdconfig.sys

C:\>country
Country code       : 49
Date format        : 0001h (dd mm yy)
Time format        : 01h (Bit 0: 24-hour clock = YES)
Thousands separator: .
Decimal separator  : ,
Date separator     : .
Time separator     : :
Data-list separator: ,
Currency symbol    : €
Currency format    : 03h (Bit 0: Currency symbol follows value = YES
                          Bit 1: Space between value and currency symbol = YES
                          Bit 2: Currency symbol replaces decimal point = NO)
Currency precision : 2
Case map routine   : 00D9:12EE
C:\>ver/r
 
FreeCom version 0.85a - GNUC - XMS_Swap [Jan  2 2022 16:39:27]
DOS version 7.10
FreeDOS kernel - GIT (build 2043 OEM:0xfd) [compiled Jan  3 2022]    

I'll try the other programs, but I don't see anything wrong there, or did I miss something?

@andrewbird
Copy link
Contributor

Infoplus
Screenshot_2022-01-03_13-07-13

@bttrx
Copy link
Author

bttrx commented Jan 3, 2022

"current git kernel/country.sys" -> That's the culprit.
If kernel find's \country.sys during boot, kernel will make use of it, although you didn't say "...,a:\country.sys" in (fd)config.sys.
Solution is to rename or delete country.sys file in order to use the hard-coded kernel table.

@andrewbird
Copy link
Contributor

Ahh, shows my lack of DOS knowledge. I'll try again later. Thanks!

@bttrx
Copy link
Author

bttrx commented Jan 3, 2022

No problem. I also didn't know until 4 days ago, that there's a different way to provide (at least partial) country info.

@andrewbird
Copy link
Contributor

BTW your country.exe program, is it open source? If so I'd like to include it (or some version of it if it's not C) into the dosemu2 test suite?

@bttrx
Copy link
Author

bttrx commented Jan 3, 2022

Theoretically, it is open source... But it is just a little exercise done in an ancient Pascal variant (http://wiki.bttr-software.de/Cabezon/HomePage and https://github.com/cabezon-pascal/Cabezon).
That compiler required adding new functions directly to the RTL. So, w/o my modified RTL sources, country.exe source code wouldn't help you much. Unfortunately, I don't make any progress developing the compiler or the RTL, because lack of time and other things.
But country.exe is a very simple program. Could be ported to Turbo Pascal or other languages easily. Comparing country.exe's output with Info+, I already see room for improvement.

@bttrx
Copy link
Author

bttrx commented Jan 12, 2022

Any progress, @andrewbird ?

@andrewbird
Copy link
Contributor

I'll try to have a look tomorrow.

andrewbird added a commit to andrewbird/kernel that referenced this issue Jan 15, 2022
In the case that config.sys contains the directive 'COUNTRY=xxx'
and no 'country.sys' file is specified, the kernel falls back to
searching some internal hardcoded default table. If this is done
and an entry is found we need to set the country code.

[fixes #FDOS/country#5]
stsp added a commit to dosemu2/fdpp that referenced this issue Jan 16, 2022
... even if country.sys is not to be loaded.
See FDOS/country#5

Note: CountrySpecificInfoSmall struct (and the associated table)
does not contain codepage numbers. This seems like an omission,
eg COUNTRY=07 doesn't set codepage=866.
andrewbird added a commit to andrewbird/kernel that referenced this issue Jan 16, 2022
In the case that config.sys contains the directive 'COUNTRY=xxx'
and no 'country.sys' file is specified, the kernel falls back to
searching some internal hardcoded default table. If this is done
and an entry is found we need to set the country code.

[fixes #FDOS/country#5]
andrewbird added a commit to andrewbird/kernel that referenced this issue Jan 16, 2022
In the case that config.sys contains the directive 'COUNTRY=xxx'
and no 'country.sys' file is specified, the kernel falls back to
searching some internal hardcoded default table. If this is done
and an entry is found we need to set the country code.

[fixes FDOS/country#5]
@andrewbird
Copy link
Contributor

No problem. I also didn't know until 4 days ago, that there's a different way to provide (at least partial) country info.

So that's a FreeDOS only thing then, as I tried it on MSDOS 6.22 and DRDOS 7.01 and neither provided the fallback if no country.sys was present?

@bttrx
Copy link
Author

bttrx commented Jan 16, 2022

No problem. I also didn't know until 4 days ago, that there's a different way to provide (at least partial) country info.

So that's a FreeDOS only thing then, as I tried it on MSDOS 6.22 and DRDOS 7.01 and neither provided the fallback if no country.sys was present?

I didn't try on other DOS, but I think, you're right.

@bttrx
Copy link
Author

bttrx commented Jan 31, 2022

Sorry, to bother again, but any news, @andrewbird ?

@andrewbird
Copy link
Contributor

Hello @bttrx,
I don't know really. I did a quick fix that works okay for me, but after @stsp did a similar but different fix for FDPP I wasn't sure what to do about mine. I think I made the mistake of asking @PerditionC for thoughts in a comment to my commit andrewbird/kernel@8751e33c345, but that commit subsequently got tweaked and so the comment became mostly inaccessible unless you know where to look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants