Modify

Opened 2 months ago

Closed 2 months ago

Last modified 2 months ago

#16368 closed defect (fixed)

DateTimeException importing exported notes with persian numbers

Reported by: Iman <iriman@…> Owned by: team
Priority: normal Milestone: 18.06
Component: Core notes Version: latest
Keywords: persian locale import export i18n number date Cc:

Description

In Windows 7 my settings for region and language format is set to Persian.
When I export Notes it uses Persian digits for timestamps and then I cannot reimport it. By replacing Persian digits with English ones importing is done.

Attachments (1)

notes.osn (1.9 KB) - added by Iman <iriman@…> 2 months ago.
Sample exported file with Persian locale on windows 7

Download all attachments as: .zip

Change History (8)

Changed 2 months ago by Iman <iriman@…>

Attachment: notes.osn added

Sample exported file with Persian locale on windows 7

comment:1 Changed 2 months ago by Don-vip

Keywords: i18n added

comment:2 Changed 2 months ago by Don-vip

Keywords: number date added; notes windows removed
Milestone: 18.06
Summary: Importing exported notesDateTimeException importing exported notes with persian numbers

Indeed:

java.time.DateTimeException: Invalid value for MonthOfYear (valid values 1 - 12): 19014
	at java.time.temporal.ValueRange.checkValidValue(ValueRange.java:311)
	at java.time.temporal.ChronoField.checkValidValue(ChronoField.java:703)
	at java.time.LocalDate.of(LocalDate.java:267)
	at java.time.LocalDateTime.of(LocalDateTime.java:361)
	at java.time.ZonedDateTime.of(ZonedDateTime.java:339)
	at org.openstreetmap.josm.tools.date.DateUtils.tsFromString(DateUtils.java:92)
	at org.openstreetmap.josm.tools.date.DateUtils.fromString(DateUtils.java:72)
	at org.openstreetmap.josm.io.NoteReader$Parser.startElement(NoteReader.java:110)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:374)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:842)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
	at org.openstreetmap.josm.tools.XmlUtils.parseSafeSAX(XmlUtils.java:114)
	at org.openstreetmap.josm.io.NoteReader.parse(NoteReader.java:218)
	at org.openstreetmap.josm.io.OsmServerLocationReader$NoteParser.parse(OsmServerLocationReader.java:254)
	at org.openstreetmap.josm.io.OsmServerLocationReader$NoteParser.parse(OsmServerLocationReader.java:1)
	at org.openstreetmap.josm.io.OsmServerLocationReader.doParse(OsmServerLocationReader.java:136)
	at org.openstreetmap.josm.io.OsmServerLocationReader.parseRawNotes(OsmServerLocationReader.java:188)
	at org.openstreetmap.josm.io.OsmServerLocationReader.parseRawNotes(OsmServerLocationReader.java:183)
	at org.openstreetmap.josm.actions.downloadtasks.DownloadNotesTask$DownloadRawUrlTask.realRun(DownloadNotesTask.java:206)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:95)
	at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:143)
	... 5 more
Version 0, edited 2 months ago by Don-vip (next)

comment:3 Changed 2 months ago by Don-vip

What happens for .osm files? Did they get a timestamp with persian numbers too?

comment:4 Changed 2 months ago by Don-vip

Resolution: fixed
Status: newclosed

In 13903/josm:

fix #16368 - export lat/lon and timestamps in .osn files as we do in .osm files: locale-independent

comment:5 in reply to:  3 ; Changed 2 months ago by Iman <iriman@…>

Replying to Don-vip:

What happens for .osm files? Did they get a timestamp with persian numbers too?

No. At the same time .osm files had a timestamp with English numbers. There was no problem with .osm files.

comment:6 in reply to:  5 Changed 2 months ago by Don-vip

Replying to Iman <iriman@…>:

No. At the same time .osm files had a timestamp with English numbers. There was no problem with .osm files.

OK so the fix should work :)

One bonus question: do you contribute to the Persian translation? We noticed someone updated it today. I would love to add this new language once the 2000 core strings threshold is reached.

comment:7 Changed 2 months ago by anonymous

thanks for the fix.

that's a good news. :)
I have it in my plan and wish to do it.
That contributor is not me, today I just registered on launchpad with no contribution yet.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.