Modify

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#16368 closed defect (fixed)

DateTimeException importing exported notes with persian numbers

Reported by: iman 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 6 years ago.
Sample exported file with Persian locale on windows 7

Download all attachments as: .zip

Change History (8)

by iman, 6 years ago

Attachment: notes.osn added

Sample exported file with Persian locale on windows 7

comment:1 by Don-vip, 6 years ago

Keywords: i18n added

comment:2 by Don-vip, 6 years ago

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

Indeed:

<note id="-3" lat="34.1002049366592" lon="49.69561725586654" created_at="۲۰۱۸-۰۶-۰۸T۲۰:۱۵:۱۸+04" >
  <comment action="OPENED" timestamp="۲۰۱۸-۰۶-۰۸T۲۰:۱۵:۱۸+04" uid="4886954" user="user" is_new="true" >یادداشت</comment>
</note>
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
Last edited 6 years ago by Don-vip (previous) (diff)

comment:3 by Don-vip, 6 years ago

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

comment:4 by Don-vip, 6 years ago

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

in reply to:  3 ; comment:5 by iman, 6 years ago

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.

in reply to:  5 comment:6 by Don-vip, 6 years ago

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 by anonymous, 6 years ago

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. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.