Closed xMAC94x closed 9 months ago
Hi @xMAC94x ,
I have tried to recreate it and unfortunately cannot get the error.
Import: /home/user/Downloads/150060RS75000.zip
Identify Snapeda
Import kicad_sym
Import 3d model
Import footprint
Warning renaming footprint file "LED_150060RS75000" to "150060RS75000_LED_150060RS75000"
OK
Import: /home/user/Downloads/AZ1117CH-3.3TRG1.zip
Identify Snapeda
Import kicad_sym
Import 3d model
Import footprint
Warning renaming footprint file "DIODES_AZ1117CH-3.3TRG1_0" to "AZ1117CH-3.3TRG1_DIODES_AZ1117CH-3.3TRG1_0"
OK
Import: /home/user/Downloads/C2012X7R1E105M085AB.zip
Identify Snapeda
Import kicad_sym
Import 3d model
Import footprint
Warning renaming footprint file "CAPC2012X100N" to "C2012X7R1E105M085AB_CAPC2012X100N"
OK
Import: /home/user/Downloads/GRM188R61E475KE11D.zip
Identify Snapeda
Import kicad_sym
Import 3d model
Import footprint
Warning renaming footprint file "CAPC1608X95N" to "GRM188R61E475KE11D_CAPC1608X95N"
OK
Import: /home/user/Downloads/SFR10EZPJ101.zip
Identify Snapeda
Import kicad_sym
Import 3d model
Import footprint
Warning renaming footprint file "RESC2012X65N" to "SFR10EZPJ101_RESC2012X65N"
OK
Which option did you select when downloading? I have selected "KiCad / V6 & Later" at Snapeda. Which Kicad version as well as which plugin version. What system is KiCad running on and in which language?
Regards Steffen-W
I assume that the error has been resolved.
@Steffen-W I'm facing the same errors as @xMAC94x. On my system I also can reproduce the messages from the original post with the mentioned Parts.
For example the: https://www.snapeda.com/parts/AZ1117CH-3.3TRG1/Diodes+Inc./view-part/ Downloaded as Kicad v6 & later.
Error Message:
Import: /Users/tobias/Downloads/AZ1117CH-3.3TRG1.zip
Identify Snapeda
‚ascii‘ codec can’t decode byte 0xc2 in position 1737: ordinal not in range(128)
looking through the *.kicad_sym file there is the following character U+00b0 "°" that is the problem. One example:
(property "TEMPERATURE_RANGE_LOW" "-20°C" (id 12) (at 0 0 0)
(effects (font (size 1.27 1.27)) (justify bottom) hide)
)
visual studio code warning message:
The character U+00b0 "°" is not a simple ASCII character.
after deleting every instance of this character and creating a zip again the import works fine.
My system comprises of the following versions:
Application: KiCad PCB Editor
Version: (6.0.10-0), release build
Libraries:
wxWidgets 3.1.5
libcurl/8.1.2 SecureTransport (LibreSSL/3.3.6) zlib/1.2.11 nghttp2/1.51.0
Platform: macOS Version 13.6.1 (Build 22G313), 64 bit, Little endian, wxMac
Build Info:
Date: Dec 18 2022 11:46:04
wxWidgets: 3.1.5 (wchar_t,wx containers)
Boost: 1.80.0
OCC: 7.6.3
Curl: 7.64.1
ngspice: 38
Compiler: Clang 12.0.0 with C++ ABI 1002
Build settings:
KICAD_USE_OCC=ON
KICAD_SPICE=ON
impart gui for kicad:
2023.10.20
EDIT: The Kicad Language is set to default -> English The MacOS System language is German
Please let me know if i should open a new issue instead of appening to this one. Also if you need any further information testing I'm happy to help.
Hi @42CrMo4,
thank you very much for your detailed description of the problem. I have now taken a closer look at it.
‚ascii‘ codec can’t decode byte 0xc2 in position 1737: ordinal not in range(128)
name: DEGREE SIGN "°" Unicode: U+00B0 UTF-8: c2 b0
My Setting: de_DE.UTF-8 and Linux Mint
What is output when you do the following?
import sys
print(sys.getdefaultencoding())
is it ascii?
KiCad seems to have no problem with the characters. It is only Python. Unfortunately I don't have a solution at the moment.
Thank you for taking another look.
if i run in the kicad terminal
import sys
print(sys.getdefaultencoding())
i get utf-8
No, prolem. I will also take a look on another PC.
Just a quick check, i did the same with KiCAD 7.0.10 . unfortunately the same result.
I think I found a solution that fixed it, at least for me. Specifing the encoding in the read_text() functions.
read_text()
to
read_text(encoding='utf-8' )
If you want, I can provide a pull request tomorrow.
Hi, importing of Some of my Snapeda v6 files failes with an ascii codec error. The relevant files are:
here the detailed import protocol: