Sparx Systems Forum

Enterprise Architect => Bugs and Issues => Topic started by: nafetsreuab on October 16, 2024, 10:26:27 pm

Title: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: nafetsreuab on October 16, 2024, 10:26:27 pm
Dear Forum,

generating a pdf or docx-file through document generation (F8) Unicode-encodes Umlauts (öüä) and some special-signs (ß) in the export-document.

Example:

Type: FunctionalRequirement
Name: ä

Requirement Notes-Field: ä

During export only the umlauts in the Requirement-Notes-Field get Unicode-encoded not the Name-field even though it contains the same text.

Result:

Name: ä
Notes: ä

I tried all possible variations of Codepage/Language/Charset to no avail.

any help is greatly appreciated.

Regards

Steve
Title: Re: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: Geert Bellekens on October 16, 2024, 11:32:40 pm
How do you get the notes into the document?

That matters because the notes in EA are stored using a markdown format.
When getting the notes through an SQL or script fragment, you need to tell EA that the notes contain formatted text, and it will translate it for you.

If you do it using the regular templates, you shouldn't have that problem because EA knows it needs to translate notes fields.

You can test this theory by setting test bold in the notes of your requirement.
That show up as <b>bold text</b>

Geert
Title: Re: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: nafetsreuab on October 17, 2024, 12:42:56 am
Hi Geert,

thanks for your time.

I just select Functional Requirement from the Toolbox and drop it in a folder with other requirements or into a completely new folder.
Then i select the requirement and simply change Name and type 'ö' in The notes field. No manual sql at all.

Then as described, -> F8, Generate. then examine the resulting document. Then, the notes-field in the document shows &#246;

Regarding your test; I set <b>bold text</b> in the notes field. Result in document is similar wrong:

&lt;b&gt;bold text&lt;/b&gt;

Looks like EA is not capable of doing translation.
Title: Re: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: Geert Bellekens on October 17, 2024, 12:49:52 am
Which template are you using? It's the template that could possibly use sql or a script to get the info.

Geert
Title: Re: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: nafetsreuab on October 17, 2024, 01:07:23 am
I feel sorry. Indeed there is sql fragment in the template i inherited.

Code: [Select]
select CASE
WHEN id.value is null THEN '--'
ELSE id.value END as reqid, req.note as reqnote, req.name as reqname
from (((t_object as uc
left join t_connector as rcon on rcon.Connector_Type ='realisation' and rcon.end_object_id = uc.object_id)
inner join t_object as req on req.object_id = rcon.start_object_id)
left join t_objectproperties as id on id.object_id = req.object_id and id.property ='Customer_UID')
where uc.object_type = 'usecase'
and uc.object_id =  #OBJECTID#
order by reqid desc
Title: Re: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: Geert Bellekens on October 17, 2024, 04:32:50 am
You need to add .Formatted to the reqnote. See https://sparxsystems.com/enterprise_architect_user_guide/17.0/model_publishing/create_a_custom_sql_query.html (https://sparxsystems.com/enterprise_architect_user_guide/17.0/model_publishing/create_a_custom_sql_query.html) for details

Geert
Title: Re: Generate Document Unicode-encodes Umlauts but only in Requirement-Notes-Fields
Post by: nafetsreuab on October 17, 2024, 11:34:32 pm
Thank you alot! Thats it. Works.  :)