mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 18:43:51 +00:00
fix Windows locale: force decimal dot in JSON state message
Format() used the system locale decimal separator, so on Russian/Eastern
European Windows smeter_dbm and float fields got commas ("−87,5"), producing
invalid JSON that JS silently dropped — breaking S-meter and frequency display.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-1
@@ -1168,7 +1168,11 @@ function TWebServer.BuildStateJson: string;
|
||||
const
|
||||
MODE_N: array[0..7] of string =
|
||||
('LSB','USB','DSB','CWL','CWU','FM','AM','SAM');
|
||||
var
|
||||
FS: TFormatSettings;
|
||||
begin
|
||||
FS := DefaultFormatSettings;
|
||||
FS.DecimalSeparator := '.';
|
||||
FStateLock.Enter;
|
||||
try
|
||||
Result := Format(
|
||||
@@ -1204,7 +1208,7 @@ begin
|
||||
FAttnIdx,
|
||||
BoolToStr(FTuning, 'true', 'false'),
|
||||
BoolToStr(FDuplex, 'true', 'false')
|
||||
]);
|
||||
], FS);
|
||||
finally
|
||||
FStateLock.Leave;
|
||||
end;
|
||||
|
||||
Reference in New Issue
Block a user