Bug 135994 - Offer an optional target locale for export to CSV
Summary: Offer an optional target locale for export to CSV
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack, skillCpp
Depends on:
Blocks: CSV-Dialog
  Show dependency treegraph
 
Reported: 2020-08-21 18:33 UTC by linus.kardell
Modified: 2022-09-01 03:46 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description linus.kardell 2020-08-21 18:33:24 UTC
Description:
If you have a CSV with numbers with dots, Calc will change it into commas

Steps to Reproduce:
1. Open a CSV with number with dots
2. Save it

Actual Results:
Calc changes with dots into commas, and if you save it, it will change them into commas in the file, which is pretty stupid to do in a CSV

Expected Results:
The number format should be preserved.


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
Version: 7.0.0.0.beta2
Build ID: 00(Build:0)
CPU-trådar: 8; Operativsystem: Linux 5.7; UI-rendering: GL; VCL: kf5
Locale: sv-SE (sv_SE.UTF-8); UI: sv-SE
Calc: CL
Comment 1 Eike Rathke 2020-08-21 21:35:35 UTC
Imported numbers and dates are displayed with the formats of the current locale, which for you is Swedish (sv-SE) that uses comma as decimal separator. This is expected and normal behaviour. Saving to CSV uses the locale settings of the cells, which normally is expected by users.

To force a dot decimal separator you can assign number formats of a locale that uses dot as decimal separator, for example English-UK (en-GB), to the data after import. Or before or after import set the overall locale to an English one under Tools -> Options -> Language Settings -> Languages, Locale setting; which switches all display formats' default locale.

However, I agree that when exporting to CSV an optional target locale could be offered to override the cells' number format locale(s).
Comment 2 linus.kardell 2020-08-21 21:44:59 UTC
It should automatically use the same locale for exporting that it used for importing.
Comment 3 Mike Kaganski 2022-08-31 06:27:01 UTC
Since resolution of bug 55236, the import settings are remembered.
The settings do not include the locale defined in import, which should be included for the sake of this bug.

Additionally, the export CSV filter settings dialog should include this option.

Commit 781c026f98c848025f313940c94cbd4553259901 is a code pointer. Making this an easyhack.