Jump to content

SVG not work open file.


Recommended Posts

That's easy to fix, just replace the first line in the SVG file ...

<?xml version='1.0' encoding='ascii'?>

... inside an text editor to ...

<?xml version='1.0' encoding="UTF-8"?>

... so 'ascii' to "UTF-8".

0001_fix.jpg.0c09557e94ca34779ce68fa2953cd124.jpg

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

For what very little it is worth, the file opens fine as is in Pixelmator Pro on my Mac, & from that app if I export it as a new SVG file, Affinity opens it without issues apparently because Pixelmator exports it with the UTF-8 encoding. Same thing with Inkscape & the default(?) SVG 'save as' option.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

Oh I see many thanks for your help about .SVC ascii to UTF-8 I got you.

Need to open feature appear. for example: alert notification said. .SVG is not support but do you want edit text 'ascii' to 'UTF-8' then (save) (cancel) button auto save .svg and open same time itself. 

Link to comment
Share on other sites

1 minute ago, Kent Davis said:

Need to open feature appear. for example: alert notification said. .SVG is not support but do you want edit text 'ascii' to 'UTF-8' then (save) (cancel) button auto save .svg and open same time itself. 

Much better would be for Affinity to behave like for example Inkscape or Pixelmator & open the file even if it was saved with ascii encoding....

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

1 minute ago, Kent Davis said:

I mean appear alert 

There is no alert in either of those Mac apps, if that is what you mean. They just open SVG files with ascii encoding without problems. Affinity should do the same.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

'ascii' cause problem open Affinity all app not work. hard for me to remember word rename from 'ascii' to 'UTF-8'

Affinity all app never work on 'ascii' .svg

 

Need add feature auto appear to ask want save button to appear itself.

Link to comment
Share on other sites

3 minutes ago, Kent Davis said:

Need to open feature appear. for example: alert notification said. .SVG is not support but do you want edit text 'ascii' to 'UTF-8' then (save) (cancel) button auto save .svg and open same time itself. 

It's more a matter of how the Affinity SVG parser checks/interprets/parses the SVG/XML encoding setup from a SVG file, so in this case that it just has to accept "ascii" too here not just "UTF-8" as an setup encoding.

For example the omission of the XML encoding specification would also open a SVG in ADe just fine ...

<?xml version="1.0" standalone="no"?>
<svg width="5cm" height="4cm" version="1.1"
     xmlns="http://www.w3.org/2000/svg">
  <desc>Four separate rectangles
  </desc>
    <rect x="0.5cm" y="0.5cm" width="2cm" height="1cm"/>
    <rect x="0.5cm" y="2cm" width="1cm" height="1.5cm"/>
    <rect x="3cm" y="0.5cm" width="1.5cm" height="2cm"/>
    <rect x="3.5cm" y="3cm" width="1cm" height="0.5cm"/>

  <!-- Show outline of viewport using 'rect' element -->
  <rect x=".01cm" y=".01cm" width="4.98cm" height="3.98cm"
        fill="none" stroke="blue" stroke-width=".02cm" />

</svg>

... so it's only the 'ascii' encoding setting which it doesn't know to interpret here!

 

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

Allright I know you never listen from me what I am try tell you.

I am not good english. I do know American Sign Language.

You said 'ASCII' it work to open Affinity????

You saw alert appear said not support because of 'ASCII'

I make me many frustrate.

Link to comment
Share on other sites

9 hours ago, Kent Davis said:

Allright I know you never listen from me what I am try tell you.

I am not good english. I do know American Sign Language.

You said 'ASCII' it work to open Affinity????

You saw alert appear said not support because of 'ASCII'

I make me many frustrate.

I know what you mean, but that's overall too complicated and unnecessary to show up a warning message in a panel and asking after using UTF-8 instead etc. - It's much easier for them to fix it by adding into their SVG parser the recognition of "UTF-8 | ascii" tokens and that's all about it. It's usually much easier & quicker to do!

svg-flow.png.2fe182464aedaa6d0dab36201436a9ef.png

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

12 minutes ago, Kent Davis said:

'ascii' cause problem open Affinity all app not work. hard for me to remember word rename from 'ascii' to 'UTF-8'

You would not need to remember anything or edit the file in any way if the Affinity SVG parser could correctly interpret the ascii encoding, like @v_kyr mentioned.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

9 minutes ago, Kent Davis said:

I am not good english.

If there is another language you are more comfortable using, just use that. There are translation services we can use to convert it to English if needed, although there may already be someone fluent in that language who will reply using it as well.

All 3 1.10.8, & all 3 V2.5.5 Mac apps; 2020 iMac 27"; 3.8GHz i7, Radeon Pro 5700, 32GB RAM; macOS 10.15.7
A
ll 3 V2 apps for iPad; 6th Generation iPad 32 GB; Apple Pencil; iPadOS 15.7

Link to comment
Share on other sites

10 hours ago, v_kyr said:

For example the omission of the XML encoding specification would also open a SVG in ADe just fine ...

Just in case: This sample svg code appears to be missing something. AD (V1) opens an error message and Gapplin says "

This page contains the following errors:
error on line 1 at column 3: xmlParsePI : no target name error on line 1 at column 3: Encoding error

svgsample1.jpg.6d5d68b0aae062810bdc59f274ca977c.jpg svgsample2.thumb.jpg.4bfbf9fe01c3f3db1ad4795993ff0c5c.jpg 

@Kent Davis, you might know this site already but I am impressed that this dictionary gets created at all: https://www.handspeak.com/word/asl-eng/
Unfortunately its dictionary English -> ASL is not specialised yet for technical / computer terms and does not know for instance ASCII, Unicode, parser, encoding

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

No no. I am not talk about ASL computer. I talk about "I am full deaf and I do know sign language" myself. ASL = American Sign Language (person with hand movement).

ASL is not as word.

 

SVG yes many problem because they said "not need" make me upset. They must to fix add feature 'ascii' -VS- 'UFT-8' everyone don't know. I has been frustrate SVG not work all Affinity for many years until finally yesterday they told me. I know everyone don't know too.

Link to comment
Share on other sites

11 hours ago, Kent Davis said:

hard for me to remember word rename from 'ascii' to 'UTF-8'

It also works if I just delete in your file

encoding='ascii'

so the first line is

<?xml version='1.0' ?>

svgsample3.thumb.jpg.77759c64ed18947a2308e501faeee637.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

24 minutes ago, thomaso said:

Just in case: This sample svg code appears to be missing something. AD (V1) opens an error message and Gapplin says "

Nope, not for me in ADe v1 ...

test1.jpg.f3cf637da92eb7b2baf284d3e260d2c0.jpg

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

34 minutes ago, thomaso said:

Just in case: This sample svg code appears to be missing something. AD (V1) opens an error message and Gapplin says "

This page contains the following errors:
error on line 1 at column 3: xmlParsePI : no target name error on line 1 at column 3: Encoding error

svgsample1.jpg.6d5d68b0aae062810bdc59f274ca977c.jpg svgsample2.thumb.jpg.4bfbf9fe01c3f3db1ad4795993ff0c5c.jpg

Well if you look closer at your stupidly to german TRANSLATED "SVG code" that's no wonder, since that generated text/code gaps which will generated syntax errors on parsing in as SVG!

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

5 minutes ago, Kent Davis said:

Yes I agree with you AD1 but I have AD2.

There shouldn't usually be a difference between ADe v1 & ADe v2 here, also thomaso feeded in pretty wrong formated (to german translated with massive gaps) SVG code above, which either way wouldn't work that way in any SVG parser.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

40 minutes ago, v_kyr said:

Well if you look closer at your stupidly to german TRANSLATED "SVG code" that's no wonder, since that generated text/code gaps which will generated syntax errors on parsing in as SVG!

Thanks, that's it indeed. Although I did neither "TRANSLATE" nor edit the copy/pasted code it got its single space characters multiplied in an odd way when pasting it into an open TextEdit window. While your test1.svg works to me as expected I am unable to reproduce the copy/paste spaces issue once more.

svgspacecharissue.jpg.020cc1d55241448c33cddfb6d462bd46.jpg

macOS 10.14.6 | MacBookPro Retina 15" | Eizo 27" | Affinity V1

Link to comment
Share on other sites

You can download Visual Studio Code.app because DreamWeaver.app -VS- Visual Studio Code.app

Visual Studio Code.app is 100% free forever. Download Visual Studio Code - Mac, Linux, Windows

I do use many times there is highest quality.

You can open .svg to Visual Studio Code.app is much better than TextEdit.app

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.