39aldo39 / klfc

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

Not happy with my beautiful json. #48

Open iandoug opened 2 years ago

iandoug commented 2 years ago

Hi

Am trying to write your format file from KLA json.

It would be convenient to specify all 4 slots on a key at the same time, even if some are empty.

Your program does not like my input, but I can't see what the error is.

Error in $: Failed reading: Cannot decode input: Data.Text.Internal.Encoding.decodeUtf8: Invalid UTF-8 stream. Expecting object value at ',,,]},' zxcv-fingers.en.ansi.txt

Any ideas?

Thanks, Ian

39aldo39 commented 2 years ago

While your JSON is indeed beautiful, it is also invalid :( The ' at key AC11 is not allowed to be escaped. That fixes the error, after also changing localeID to localeId, but that error is clearer.

iandoug commented 2 years ago

So noted, thanks.

I was using PHP addslashes function, instead of manually checking each of the four slots for chars to escape.

PHP and Json have different ideas about what needs to be escaped ...

Thanks, Ian

iandoug commented 2 years ago

Ok, PHP was FOS with the escaping so I programmed around it and it works now.

What exactly do the scripts do with XCompose? I can't quite figure it out ... or why they need to do anything with it.

I'm only going to do the "conventional ANSI" layouts for now, need to figure out how to specify things that make creative use of non-letter keys.

Thanks, Ian

iandoug commented 2 years ago

BTW good job on this.