Discussion:
[Audacity-devel] Text labels exported using the current user locale
Steve the Fiddle
2016-12-06 11:50:35 UTC
Permalink
Thanks for your feedback Antonio,

I agree that it would be better (more portable) for the label times to
be exported in a locale independent way.

I have forwarded your message to the developer's mailing list
(https://lists.sourceforge.net/lists/listinfo/audacity-devel and BCc:
to you with your email address removed from the post to respect your
privacy).

As you appear to be familiar with GitHub, you may want to consider
sending a pull request with a patch for this.
It is very unlikely that the patch would be merged immediately as we
are currently in "code freeze", in readiness for the next Audacity
release, but a pull request would serve as a useful reminder for after
2.1.3 is released.

Regards,

Steve
Hi,
first of all thanks for Audacity.
I am using Audacity 2.1.2, from Debian.
I noticed that Audacity exports the labels track using the current user
locale, in my case (it_IT.utf-8) that means that the floating point
numbers indicating the start and the end of the labeled interval use a
comma as a decimal separator.
Audacity seems to be able to re-import the file independently of the
locale because it uses Internat::CompatibleToDouble() when importing
https://github.com/audacity/audacity/blob/edb99485da0a5518c8915c0c371b4646e59a0b9c/src/LabelTrack.cppImport
https://github.com/audacity/audacity/blob/17afc51644b2b327e173a23d6066dde598838c03/src/Internat.cpp#L82
However it exports just using the "%f" format specifier which is locale
https://github.com/audacity/audacity/blob/edb99485da0a5518c8915c0c371b4646e59a0b9c/src/LabelTrack.cppImport
Exporting with commas can make the exported file less portable,
especially if one wants to parse it with an external tool.
Would you consider exporting the labels in a locale independent way?
I.e. using always a period as a decimal separator.
Maybe export using Internat::ToString for symmetry with the import
functionality?
https://github.com/audacity/audacity/blob/17afc51644b2b327e173a23d6066dde598838c03/src/Internat.cpp#L98
This should not break the import step for file exported with older
versions because Audacity can already import files with either commas or
periods in floating point values.
Thanks,
Antonio
--
Loading...