mirror of
https://git.vladimir.cc/vladimir/ewsdr.git
synced 2026-08-25 20:37:33 +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
|
const
|
||||||
MODE_N: array[0..7] of string =
|
MODE_N: array[0..7] of string =
|
||||||
('LSB','USB','DSB','CWL','CWU','FM','AM','SAM');
|
('LSB','USB','DSB','CWL','CWU','FM','AM','SAM');
|
||||||
|
var
|
||||||
|
FS: TFormatSettings;
|
||||||
begin
|
begin
|
||||||
|
FS := DefaultFormatSettings;
|
||||||
|
FS.DecimalSeparator := '.';
|
||||||
FStateLock.Enter;
|
FStateLock.Enter;
|
||||||
try
|
try
|
||||||
Result := Format(
|
Result := Format(
|
||||||
@@ -1204,7 +1208,7 @@ begin
|
|||||||
FAttnIdx,
|
FAttnIdx,
|
||||||
BoolToStr(FTuning, 'true', 'false'),
|
BoolToStr(FTuning, 'true', 'false'),
|
||||||
BoolToStr(FDuplex, 'true', 'false')
|
BoolToStr(FDuplex, 'true', 'false')
|
||||||
]);
|
], FS);
|
||||||
finally
|
finally
|
||||||
FStateLock.Leave;
|
FStateLock.Leave;
|
||||||
end;
|
end;
|
||||||
|
|||||||
Reference in New Issue
Block a user