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