parse error when loading file with Unicode BOM

Bug #1540810 reported by Pascal REYGNER
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Won't Fix
Low
Unassigned

Bug Description

my today version : (kicad_pcb (version 4) (host pcbnew 4.0.1-stable)
i try to open kicad-pcb files made with old version : : (kicad_pcb (version 3) (host pcbnew "(2013-07-07 BZR 4022)-stable")
i have changed layer names as explained in Kicad web site, with notepad editor, the first error (unknowed layers) disappeared.

Now, when i try to open old file, the following message appears :

"erreur en chargement du CB.
Parse error : Attendu "(" in input source <nom du fichier .kicad_pcb...>
line 1
offset 1 ..."

i join the Kicad-pcb file

do you have qny idea ?
Thank you

Revision history for this message
Pascal REYGNER (preygner) wrote :
Revision history for this message
Kerusey Karyu (keruseykaryu-deactivatedaccount) wrote :

Do not try to edit kicad_pcb file with system Notepad under Windows. Use another plain text editor with UTF-8 (without BOM) support.

Revision history for this message
Chris Pavlina (pavlina-chris) wrote :

I'm going to call this a bug. Unicode allows the BOM in UTF-8, even though it's pointless. We have definitely suggested people edit things with text editors before, and some text editors (incl Notepad) add the BOM. Many Unicode-supporting editors (incl Vim) do not display this mark if it is there, so there isn't much way to see it unless you know what you're looking for. It shouldn't be hard to ignore it if it happens to exist at the beginning of a file.

Changed in kicad:
status: New → Confirmed
importance: Undecided → Low
summary: - parse error when loading pcb files made with old version
+ parse error when loading file with Unicode BOM
Revision history for this message
Pascal REYGNER (preygner) wrote : RE: [Bug 1540810] Re: parse error when loading pcb files made with old version

Bonjour,
Merci, ça marche !!
Sincèrement.
Pascal Reygner - Consultant
Entreprise IrisProjets
WEB : www.IrisProjets.fr
📱 +33 6 60 04 45 87

-----Message d'origine-----
De : <email address hidden> [mailto:<email address hidden>] De la part de Kerusey Karyu
Envoyé : mardi 2 février 2016 12:36
À : <email address hidden>
Objet : [Bug 1540810] Re: parse error when loading pcb files made with old version

Do not try to edit kicad_pcb file with system Notepad under Windows. Use another plain text editor with UTF-8 (without BOM) support.

--
You received this bug notification because you are subscribed to the bug report.
https://bugs.launchpad.net/bugs/1540810

Title:
  parse error when loading pcb files made with old version

Status in KiCad:
  New

Bug description:
  my today version : (kicad_pcb (version 4) (host pcbnew 4.0.1-stable)
  i try to open kicad-pcb files made with old version : : (kicad_pcb (version 3) (host pcbnew "(2013-07-07 BZR 4022)-stable")
  i have changed layer names as explained in Kicad web site, with notepad editor, the first error (unknowed layers) disappeared.

  Now, when i try to open old file, the following message appears :

  "erreur en chargement du CB.
  Parse error : Attendu "(" in input source <nom du fichier .kicad_pcb...>
  line 1
  offset 1 ..."

  i join the Kicad-pcb file

  do you have qny idea ?
  Thank you

To manage notifications about this bug go to:
https://bugs.launchpad.net/kicad/+bug/1540810/+subscriptions

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

While I understand your logic, technically this is not a bug. Pcbnew
will never save the board file with a UTF-8 BOM which is why I don't
think this falls under the category of a bug. I would rather not hack
the board file parser to accept the UTF-8 BOM if we don't have to.
Modifying the board file with a text editor is one of those grey areas
where lots of things can go wrong. That being said we have asked the
few unfortunate users who have renamed their non-copper layers to use a
text editor to revise the layer names. We should at the very least warn
them about using a text editor that silently adds a UTF-8 BOM (which
apparently notepad does) to their board files on the website.

On 2/2/2016 10:43 AM, Chris Pavlina wrote:
> I'm going to call this a bug. Unicode allows the BOM in UTF-8, even
> though it's pointless. We have definitely suggested people edit things
> with text editors before, and some text editors (incl Notepad) add the
> BOM. Many Unicode-supporting editors (incl Vim) do not display this mark
> if it is there, so there isn't much way to see it unless you know what
> you're looking for. It shouldn't be hard to ignore it if it happens to
> exist at the beginning of a file.
>
> ** Changed in: kicad
> Status: New => Confirmed
>
> ** Changed in: kicad
> Importance: Undecided => Low
>
> ** Summary changed:
>
> - parse error when loading pcb files made with old version
> + parse error when loading file with Unicode BOM
>

Revision history for this message
jean-pierre charras (jp-charras) wrote :

Note also there is no need to edit these files:

Just load then with the 2013-07-07 BZR 4022 -stable Pcb version and save them in old .brd format, which can be read by the new (current) stable version.
or
Run the 2013-07-07 BZR 4022 -stable Pcb version and switch the language to English.
close and rerun Pcbnew, load and save the .kicad_pcb file version 3: the layers names will be saved in English.

Revision history for this message
Jeff Young (jeyjey) wrote :

Since this is 2 years old with no activity, and there was never consensus to fix it even two years ago, I'm going to close it as Won't Fix.

(As always, if you disagree just pop it back open.)

Changed in kicad:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.