39aldo39 / klfc

Keyboard Layout Files Creator
GNU General Public License v3.0
222 stars 12 forks source link

MSKLC does not accept LF line endings generated on Linux #34

Open barkloaf opened 3 years ago

barkloaf commented 3 years ago

no matter what i do, i cannot seem to get a klc file exported by klfc into msklc correctly without that (sadly nondescriptive) error i have a json file in your format that i want to use, mainly in xkb (which works) and klc i even imported a working klc file (after doing what was referenced in issue #29 ) into the json format, and then exported the json back into klc and it still does not work

this is the file i want to work (not the file i converted klc -> json -> klc): us-refor.klc.txt and yes, it's a modified version of US-International to suit my wants, oft-performed genre of keyboard layouts but i mean that layout is just such a good start so why not

apologies if this isn't the right place to ask

DreymaR commented 3 years ago

I just tried out your file in MSKLC and there's no problem for me. I loaded your layout file into a .klc file, validated and tested it.

Colemak-eD is a lot better anyway.  ̄(=⌒ᆺ⌒=) ̄

barkloaf commented 3 years ago

I just tried out your file in MSKLC and there's no problem for me. I loaded your layout file into a .klc file, validated and tested it.

Colemak-eD is a lot better anyway.  ̄(=⌒ᆺ⌒=) ̄

well then, i have 0 idea what to do it doesn't work for me full stop. are you just using Load source file...?

DreymaR commented 3 years ago

What I actually did was fire up MSKLC, load a layout and save it as a klc file, then paste your .txt into that replacing everything.

One thought, maybe totally wrong but... Could it be a matter of line endings or document encoding being wrong for you?

barkloaf commented 3 years ago

What I actually did was fire up MSKLC, load a layout and save it as a klc file, then paste your .txt into that replacing everything.

One thought, maybe totally wrong but... Could it be a matter of line endings or document encoding being wrong for you?

alright, i did the same thing and it worked for me as well, but it would really be ideal if the klc files exported by klfc just worked initially it could definitely be an encoding thing, but i'm not sure what windows/msklc likes. i tried re-saving the original UTF-8 klfc output as UTF-16 LE in notepad, but this didn't work

DreymaR commented 3 years ago

MSKLC files should definitely have Windows line endings (\r\n). The one I'm looking at right now uses UCS-2 LE BOM encoding according to NotePad++, and that works with MSKLC. So yeah, UTF-8 may not cut it...?

barkloaf commented 3 years ago

alright, you are definitely right about the line endings a utf-8 file with only the endings changed from LF to CRLF worked for me.. so.. it might be best if the program just spat out these different line endings?

39aldo39 commented 3 years ago

I can confirm that the problem has to do with the line endings. It will output CRLF endings when executed on Windows, so it does work then. But on Linux it should also output CRLF for the KLC files, but I haven't implemented that yet.

jarnowic commented 5 months ago

I can confirm that the problem has to do with the line endings. It will output CRLF endings when executed on Windows, so it does work then. But on Linux it should also output CRLF for the KLC files, but I haven't implemented that yet.

send it through a pipe: klfc <etc> --klc <directory> | unix2dos <directory>/<keyboard>.klc and check it ...