mbridak / not1mm

Not1MM != N1MM, An amateur radio contest logger for Linux.
GNU General Public License v3.0
105 stars 26 forks source link

Program crash when exporting to Cabrillo #193

Closed awandahl closed 3 weeks ago

awandahl commented 4 weeks ago

Describe the bug Program crash when exporting to Cabrillo. I have tried CQWW CW and WPX CW, same result. Nothing to be seen in not1mm_debug.log The file is created in home directory with preamble, but no QSOs

 START-OF-LOG: 3.0
CREATED-BY: Not1MM v24.10.23
CONTEST: CQ-WW-CW
CLUB: GQRP
CALLSIGN: SE0I
LOCATION: DX
CATEGORY-OPERATOR: SINGLE-OP
CATEGORY-ASSISTED: NON-ASSISTED
CATEGORY-BAND: ALL
CATEGORY-MODE: CW
CATEGORY-TRANSMITTER: ONE
GRID-LOCATOR: JO89XI
CATEGORY-POWER: QRP
CLAIMED-SCORE: 340561
OPERATORS: @SE0I, SE0I

To Reproduce Try to export Cabrillo

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

Additional context Add any other context about the problem here.

mbridak commented 4 weeks ago

That's odd. Mine's working fine.

START-OF-LOG: 3.0
CREATED-BY: Not1MM v24.10.24
CONTEST: CQ-WW-CW
CALLSIGN: K6GTE
LOCATION: ORG
CATEGORY-OPERATOR: SINGLE-OP
CATEGORY-ASSISTED: ASSISTED
CATEGORY-BAND: ALL
CATEGORY-MODE: CW
CATEGORY-TRANSMITTER: ONE
GRID-LOCATOR: dm13at
CATEGORY-POWER: LOW
CLAIMED-SCORE: 18
OPERATORS: @K6GTE, K6GTE
NAME: Michael Bridak
ADDRESS: 2854 W Bridgeport Ave
ADDRESS-CITY: Anaheim
ADDRESS-STATE-PROVINCE: CA
ADDRESS-POSTALCODE: 92804
ADDRESS-COUNTRY: United States
EMAIL: michael.bridak@gmail.com
QSO: 14030 CW 2024-10-24 1548 K6GTE         599 3      M0MCX         599 14    
QSO: 14030 CW 2024-10-24 2129 K6GTE         599 3      SE0I          599 14    
END-OF-LOG:

Your's is stopping where the it would output your name, That's an odd place to stop. I can't think or much that would cause that. Maybe a character encoding problem?

I checked your name on QRZ The problem is probably with the Ä in your last name.

I'll test it with your name.

mbridak commented 4 weeks ago

Okay, I tried it with your name and got:

Traceback (most recent call last):
  File "/home/mbridak/Nextcloud/dev/not1mm/not1mm/__main__.py", line 3646, in generate_cabrillo
    self.contest.cabrillo(self)
  File "/home/mbridak/Nextcloud/dev/not1mm/not1mm/plugins/cq_ww_cw.py", line 327, in cabrillo
    print(
UnicodeEncodeError: 'ascii' codec can't encode character '\xe4' in position 14: ordinal not in range(128)

This will take me some noodling to work out. This could effect quite a few things like the address or club names. Speaking of which, It's always a good day when the SPRAT journal shows up in the mail.

I'll work on it.

mbridak commented 4 weeks ago

When I get back home I'll try opening the file in UTF-8 mode. That will probably clear it up. Don't know if all the contest administrators software handles UTF-8 files. You would hope so.

mbridak commented 4 weeks ago

I've pushed 24-10-24-1 which fixes this.

awandahl commented 4 weeks ago

Works fine now! I guess the question if the contests will accept logs in UTF-8 is a valid one. A post about this and related things is this one http://tlfabian.blogspot.com/2016/07/musings-on-adif-file-format.html Maybe I should spell my name "Wandahl" instead and avoid the potential problem. And yes, SPRAT days are good days!!! ;)

mbridak commented 4 weeks ago

Maybe, I sent the a message to the CQ WW / CQ WPX group thru their contact form asking if they accept UTF-8.

If they don't get back to me soon I'll probably change at-least the WW DX SSB one back to ASCII to be safe.

awandahl commented 4 weeks ago

I saw this old issue in the discussion btw https://github.com/mbridak/not1mm/discussions/64 Exactly the same thing I gather... If you change back to ASCII then maybe you can have some protection from the program simply dying, as in my case. And if "funny characters" are detected, a note about that these may have to be converted to aa (å) ae (ä) oe (ö) or whatever. I have changed my name to "Waendahl" in not1mm now ;)

mbridak commented 4 weeks ago

You're probably right. Too bad they didn't follow up.

awandahl commented 4 weeks ago

DXLog have these commands, adding an "a" for pure ASCII. Could be a way to handle things in not1mm too...


WRITELOG or MAKELOG     Exports the log to a file in Cabrillo, EDI, or ADIF format depending of type of contest.
WRITELOGA or MAKELOGA   Exports the log to a file in Cabrillo, EDI, or ADIF format depending of type of contest.
Uses plain ASCII and does not support international characters. 
``
mbridak commented 4 weeks ago

Hmm, Kinda like that. I think I'll go that route.

mbridak commented 4 weeks ago

Okay in the plain ascii file, would you want your name converted as:

ignore: 'ANDERS WNDAHL' replace: 'ANDERS W?NDAHL' xmlcharrefreplace: 'ANDERS W\ÄNDAHL' backslashreplace: 'ANDERS W\xc4NDAHL'

Or my laughable favorite: namereplace: 'ANDERS W\N{LATIN CAPITAL LETTER A WITH DIAERESIS}NDAHL'

awandahl commented 4 weeks ago

Haha... I'm pretty used to the ignore alternative actually. This is how it usually looks, fine with me.

mbridak commented 4 weeks ago

Okay, We now have a file menu option for the user to choose between ascii that doesn't crash or utf8 that doesn't crash.