KiCAD v9.0.1 can't import an LTspice schematic

LTspice uses UTF-16 LE format (without a byte order mark) for what it calls Unicode support, for any file that contains a character that cannot be represented by the system’s 8-bit extended ASCII code page.

This file contains some Cyrillic characters (see line 619 and 6120) so it is saved as UTF-16 LE.

If all characters can be saved using the extended ASCII encoding then that 8-bit UTF-8 compatible format is used instead. LTspice does not use UTF-8 encoding.

1 Like

There’s example files with µ symbols where the encoding appears to be CP-1252, and when trying to decode them in UTF-8, these symbols appear as

Some threads suggest they were planning to switch to UTF-8 (https://ez.analog.com/design-tools-and-calculators/ltspice/f/q-a/570800/issues-with-file-encoding-on-macos---workaround-bug-fix-feature-request)

1 Like

One of the developers said “Soon, in one of the next releases, the simulator core will switch to UTF-8 encoding”

I think the key word here is “were”. That message was posted in 2023-06 and there have been many updates to LTspice 24 since then. It’s now 2025-04 and the current version, 24.1.6, still uses UTF-16 LE.

I suspect they are concerned about backwards compatibility with prior versions of LTspice and are reluctant to make such a change.

I believe the mu or micro symbol is available in the extended ASCII code page that LTspice uses for 8-bit non-unicode files. It is commonly used for the 0.000001 scale multiplier for values. The user can enter the ASCII letter “u” and LTspice will convert it to a mu or micro (I’m not sure which character is included in the extended ASCII code page) for display and when saved to a file.

1 Like

The Windows CP-1252 code page encodes a micro symbol as 0xB5. This is compatible with the Unicode micro symbol U+00B5.

The Unicode encoding for the Greek small letter mu is U+03BC. I’m not sure if LTspice accepts both characters as alternate codes for the 0.000001 multiplier.

In UTF-8, U+00B5 is encoded as C2 B5. just B5 appears as

Yes, all Unicode symbols from U+0080 to U+0FFF require two bytes. A byte of 0xB5 by itself is an invalid UTF-8 code point.

In UTF-16 U+00B5 is encoded as single code point of 0x00B5 which is stored as a two byte sequence 0xB5 0x00 in a UTF-16 LE file.

LTspice only saves the file in UTF-16 LE format if there are characters that are not available in the CP-1252 extended ASCII code. If all the characters can be represented using extended ASCII then it uses that encoding and saves the file with 1 byte per character. If not, then the file is saved as UTF-16 LE with 2 bytes per character.

LTspice also omits the byte order mark sequence at the start of the file so you have to know is is saved in little endian format.

Yes, so CP-1252 isn’t really “UTF-8 compatible”

You are correct, I shouldn’t have said that. Only the 7 bit ASCII portion is UTF-8 compatible. The extended characters are invalid or look like parts of multi byte UTF-8 code sequences.

Hello and thank you for your work!

It is a regular file from LTspice 24.1.7, may be some Cyrillics and Greek letters made it look unusual.

I’m on a business trip right now, will not be able to try the RC in time. Sorry!

Thank you for the v9.0.2 RC1, much better, but still I need to do a Ctrl_A and drag to get the connection dots on the junction points.

Also there is some problem with library element’s symbol import, I’m trying to do a test to reproduce the issue.
BRB.

Do you have LTspice installed so KiCad can pick up its libraries?

I do have LTspice v24.1.7 installed “for everyone”. The libraries are at C:\Users\%username%\AppData\Local\LTspice\lib

How do I check which LTspice’s libs KiCAD can access?

This is the error message:

File at ‘C:\Users\%username%\AppData\Local\LTspice\lib\sym\potentiometer.asy’ was ignored. Using previously found file at ‘E:\LTspice\potentiometer.asy’ instead.
File at ‘C:\Users\%username%\AppData\Local\LTspice\lib\sym\ZZZ\OpAmp\K1407UD1.asy’ was ignored. Using previously found file at ‘E:\LTspice\K1407UD1.asy’ instead.
Symbol ‘ZZZ/OpAmp/K1407UD1.asy’ not found

…and the OpAmp in question (the K1407UD1) does not appear.
Also to note that the potentiometer is NOT present in the schematic I try to import.

You might want to remove any extra .asy files from E:\LTspice\

KiCad should work fine with the lib in C:\Users\%username%\AppData\Local\LTspice\lib\.

  1. removed those two *.asy files from the working folder, now the error message is

Symbol ‘ZZZ/OpAmp/K1407UD1.asy’ not found

…however it is certainly there. The slash type is strange for the Windows path (“/” vs “\”).

  1. there are several other *.asy’s there, but somehow they do not interfere with the import procedure

Is it in C:\Users\%username%\AppData\Local\LTspice\lib\sym\ZZZ\OpAmp\K1407UD1.asy?

Yes, definitely it is there.

You’ve discovered an edge case of the importer, the problem is due to directory depth (2). Fixed in the next 9.0 testing build (or soon 9.0.2).

1 Like