klfc icon indicating copy to clipboard operation
klfc copied to clipboard

MSKLC does not accept LF line endings generated on Linux

Open barkloaf opened this issue 3 years ago • 8 comments

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

barkloaf avatar May 23 '21 01:05 barkloaf

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.  ̄(=⌒ᆺ⌒=) ̄

DreymaR avatar May 24 '21 08:05 DreymaR

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...?

barkloaf avatar May 24 '21 18:05 barkloaf

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?

DreymaR avatar May 25 '21 08:05 DreymaR

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

barkloaf avatar May 25 '21 18:05 barkloaf

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...?

DreymaR avatar May 26 '21 14:05 DreymaR

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?

barkloaf avatar May 28 '21 22:05 barkloaf

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.

39aldo39 avatar Jun 29 '21 20:06 39aldo39