[Solved] Ticket #4170 - Incompatibility of spanish translation and exporting to SVG

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Nefred
Posts: 2
Joined: Thu Oct 10, 2019 6:54 pm

[Solved] Ticket #4170 - Incompatibility of spanish translation and exporting to SVG

Post by Nefred »

There is a problem of incompatibility when trying to export to a SVG file, using the Spanish translation of the program.

There are some Spanish characters (á, ó), which are generated in lines 3 and 4 of the SVG file, resulting in a void virtualisation of the SVG file when opening it in Chrome or Internet Explorer. Those files can be opened by Inkscape, or they are properly generated when using the English interface of FreeCAD. It is solved too, when editing the SVG file by using the Notepad.

But the best solution would be to avoid these "problematic" characters when generating the SVG using the Spanish File. How could it be changed?

Thank you very much!!!
Last edited by Kunda1 on Tue Jan 14, 2020 2:22 pm, edited 1 time in total.
Reason: Marked this thread as [Solved]
chrisb
Veteran
Posts: 54195
Joined: Tue Mar 17, 2015 9:14 am

Re: Incompatibility of spanish translation and exporting to SVG

Post by chrisb »

Hi and welcome to the forum!

Have you tried the latest 0.19? Please attach your full FreeCAD info as described in the IMPORTANT forum rules linked above.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
User avatar
wandererfan
Veteran
Posts: 6315
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Incompatibility of spanish translation and exporting to SVG

Post by wandererfan »

Nefred wrote: Thu Oct 10, 2019 7:03 pm There are some Spanish characters (á, ó), which are generated in lines 3 and 4 of the SVG file, ...
Lines like this?

Code: Select all

 <title>FreeCAD SVG Export</title>
 <desc>Drawing page: Page exported from FreeCAD document: _5mmCube</desc>
What version are you using please?
Nefred
Posts: 2
Joined: Thu Oct 10, 2019 6:54 pm

Re: Incompatibility of spanish translation and exporting to SVG

Post by Nefred »

Thank you very much for your answers!

I'm using the current stable version: 0.18.16131

Previously I've used a 0.16 version without any problem when exporting SVG files using the Spanish translation.

The problem is in the following lines, which are automatically generated:

Code: Select all

 <title>Exportación de SVG de FreeCAD</title>
 <desc>Página de dibujo: Page exportado desde documento de FreeCAD: __13__Pieza_1_para_acotar</desc>
 
It has to be noticed that I used this software with my 14-year-old students, and I need something stable to be easily used by them at their homes when they download FreeCAD. (if it would be only used by me, there wouldn't be any problem, because I'd edit the svg file, but...)

Thank you!
User avatar
wandererfan
Veteran
Posts: 6315
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Incompatibility of spanish translation and exporting to SVG

Post by wandererfan »

Nefred wrote: Thu Oct 10, 2019 7:03 pm There is a problem of incompatibility when trying to export to a SVG file, using the Spanish translation of the program.
I am having difficulty duplicating your results using:
OS: Linux Mint 19
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.18.3.
Build type: Release
Python version: 2.7.15+
Qt version: 5.9.5
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/Canada (en_CA)

What do you see when you try to display the svg file in IE/Chrome?
Attachments
Spanishv018.3_Firefox.png
Spanishv018.3_Firefox.png (121.84 KiB) Viewed 2364 times
Spanishv018.3_Chromium.png
Spanishv018.3_Chromium.png (71.23 KiB) Viewed 2364 times
Englishv018.3_Firefox.png
Englishv018.3_Firefox.png (120.5 KiB) Viewed 2364 times
Englishv018.3_Chromium.png
Englishv018.3_Chromium.png (66.86 KiB) Viewed 2364 times
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Incompatibility of spanish translation and exporting to SVG

Post by ulrich1a »

I am having a similar problem with German Umlauts in a drawing title of a SVG-file.
I am getting the following errormessage in Firefox at opening of such a SVG-file:

Code: Select all

XML-Verarbeitungsfehler: nicht wohlgeformt
Adresse: file:///F:/FreeCAD/Debugging/TechDraw19ISOA4Umlauts.svg
Zeile Nr. 71, Spalte 47:     <tspan xml:space="preserve">DRAWING TITLE
----------------------------------------------^
Which means: XML-computation error: not well formed.
I had to delete the garbage in the error message after DRAWING TITLE, as I got otherwise an error in the Preview of this post.
I added
ÄÖÜß
in FreeCAD to the DRAWING TITLE.
The files are attached.

My FreeCAD version is:
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.18524 (Git)
Build type: Release
Branch: master
Hash: bea009c1d52b97655dab2d5c0fbddec30989a902
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)

Ulrich
Attachments
TechDraw19ISOA4Umlauts.FCStd
(4.08 KiB) Downloaded 50 times
TechDraw19ISOA4Umlauts.zip
(1.96 KiB) Downloaded 51 times
User avatar
wandererfan
Veteran
Posts: 6315
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Incompatibility of spanish translation and exporting to SVG

Post by wandererfan »

ulrich1a wrote: Thu Oct 17, 2019 4:17 pm I am having a similar problem with German Umlauts in a drawing title of a SVG-file.
Try changing the first line of the template to this:

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
and let me know how what happens.

Thanks,
wf
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Incompatibility of spanish translation and exporting to SVG

Post by ulrich1a »

wandererfan wrote: Fri Oct 18, 2019 12:35 am Try changing the first line of the template to this:

Code: Alles auswählen

Code: Select all

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
and let me know how what happens.
I changed the line directly in the SVG-file. Firefox opens the drawing then without error message.

Ulrich
User avatar
wandererfan
Veteran
Posts: 6315
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Incompatibility of spanish translation and exporting to SVG

Post by wandererfan »

ulrich1a wrote: Fri Oct 18, 2019 7:48 am I changed the line directly in the SVG-file. Firefox opens the drawing then without error message.
Same result here.

So the template files are really encoded "Latin-1" but marked "Utf-8", or the code is inserting "Latin-1" text into a "Utf-8" document.

Thanks.
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Incompatibility of spanish translation and exporting to SVG

Post by ulrich1a »

wandererfan wrote: Fri Oct 18, 2019 2:09 pm So the template files are really encoded "Latin-1" but marked "Utf-8", or the code is inserting "Latin-1" text into a "Utf-8" document.
As the templates contain only English text, there should be no difference between "Latin-1" and "Utf-8". So I do suspect the latter, that "Latin-1" is inserted in the "Utf-8" document.

I deleted the four characters "ÄÖÜß" with an editor and the file was four bytes smaller. So this are one byte characters meaning "Latin-1" coded.

Ulrich
Post Reply