Can't open svg with Affinity Designer: Use UTF-8 encoding instead of ascii #104830

Open
opened 2023-08-10 11:47:25 +02:00 by Alexander-Gogl · 4 comments

System Information
Operating system: macOS-12.5.1-x86_64-i386-64bit 64 Bits
Graphics card: Metal API AMD Radeon Pro 555X 1.2

Blender Version
Broken: version: 3.6.1, branch: blender-v3.6-release, commit date: 2023-07-17 12:50, hash: 8bda729ef4dc
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Freestyle SVG Exporter (1, 0)
Author: Folkert de Vries

Short description of error

Affinity Designer (AD) can't open the svg file because the encoding of it is set to ascii. If I set it to UTF-8, then the file can be opened in AD and Inkscape.

Exact steps for others to reproduce the error

  1. Render image with freestyle svg export path.
  2. Open svg in Affinity Designer (is rejected)

Workaround / possible solution

Set ascii to utf-8 encoding in Blender.app/Contents/Resources/3.6/scripts/addons/render_freestyle_svg.py

# use utf-8 here to keep ElementTree happy, end result is utf-16
# NOTE algo fixed encoding issue where affinity designer rejects ascii
svg_primitive = """<?xml version="1.0" encoding="UTF-8" standalone="no"?>

# also change the encoding of all three tree.write functions to UTF-8
tree.write(filepath, encoding='UTF-8', xml_declaration=True)
**System Information** Operating system: macOS-12.5.1-x86_64-i386-64bit 64 Bits Graphics card: Metal API AMD Radeon Pro 555X 1.2 **Blender Version** Broken: version: 3.6.1, branch: blender-v3.6-release, commit date: 2023-07-17 12:50, hash: `8bda729ef4dc` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: Freestyle SVG Exporter (1, 0) Author: Folkert de Vries **Short description of error** Affinity Designer (AD) can't open the svg file because the encoding of it is set to ascii. If I set it to UTF-8, then the file can be opened in AD and Inkscape. **Exact steps for others to reproduce the error** 1. Render image with freestyle svg export path. 2. Open svg in Affinity Designer (is rejected) **Workaround / possible solution** Set ascii to utf-8 encoding in Blender.app/Contents/Resources/3.6/scripts/addons/render_freestyle_svg.py ``` # use utf-8 here to keep ElementTree happy, end result is utf-16 # NOTE algo fixed encoding issue where affinity designer rejects ascii svg_primitive = """<?xml version="1.0" encoding="UTF-8" standalone="no"?> # also change the encoding of all three tree.write functions to UTF-8 tree.write(filepath, encoding='UTF-8', xml_declaration=True) ```
Alexander-Gogl added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-08-10 11:47:25 +02:00

This is a known issue of Affinity Designer (see affinity forum). The ascii is valid for the svg.

This is a known issue of Affinity Designer (see affinity forum). The ascii is valid for the svg.
Author

Yes I know. But is there a reason to stick with ascii? Because if I open the svg in Inkscape and save it again, Inkscape will encode the file in UTF-8.

Yes I know. But is there a reason to stick with ascii? Because if I open the svg in Inkscape and save it again, Inkscape will encode the file in UTF-8.

Given this context, it seems that the bug report is more of a request to enhance Blender's export compatibility with various programs (including Affinity Designer) by adopting a more widely accepted encoding such as UTF-8 for the generated SVG file.

It's worth noting that the Blender Bug Tracker is primarily intended for reporting bugs and errors. Requests for enhancements or improvements are generally not accepted.

I'm not sure changing to UTF-8 is an ideal approach. Maybe the author of the addon, @flokkievids, can better understand the question and reply (if he is still active).

Given this context, it seems that the bug report is more of a request to enhance Blender's export compatibility with various programs (including Affinity Designer) by adopting a more widely accepted encoding such as UTF-8 for the generated SVG file. It's worth noting that the Blender Bug Tracker is primarily intended for reporting bugs and errors. Requests for enhancements or improvements are generally not accepted. I'm not sure changing to UTF-8 is an ideal approach. Maybe the author of the addon, @flokkievids, can better understand the question and reply (if he is still active).

I have the same issue. Blender won't update, Affinity won't update. Users stuck in the middle...

I have the same issue. Blender won't update, Affinity won't update. Users stuck in the middle...
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#104830
No description provided.