Author Topic: Unicode characters when selecting Note column  (Read 2663 times)

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Unicode characters when selecting Note column
« on: February 05, 2020, 10:56:59 pm »
Hi all,


I've got a problem with a doc template which uses a custom SQL query to output data from t_object.Note.

Non-English characters in this column are not output as characters in the document, but as character codes (eg É instead of É).
Selecting from the t_object.Name column does not cause this problem. In the schema, t_object.Name is an nvarchar(255) and t_object.Note is an nvarchar(max).

I get the exact same result if I run the query through EA's SQL scratch pad: it works with Name, but not with Note.

There is no formatting in the Note, just regular text.

I'm in a SQL Server repository, using client 15.0.1512 and in the XML Specifications section of my client preferences, the Code Page is set to windows-1252.

What's going on?

More to the point, how do I get it to work?


/Uffe
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13136
  • Karma: +547/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Unicode characters when selecting Note column
« Reply #1 on: February 05, 2020, 11:19:21 pm »
You have to tell EA it's formatted text.

In your (SQL Server) query do

Select o.Note as [Description-Formatted] from t_object o

In the template use {Description.Formatted}

Geert

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Unicode characters when selecting Note column
« Reply #2 on: February 05, 2020, 11:51:47 pm »
You have to tell EA it's formatted text.

It isn't formatted. It's regular, non-formatted text.
My theories are always correct, just apply them to the right reality.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: Unicode characters when selecting Note column
« Reply #3 on: February 05, 2020, 11:58:57 pm »
... but the Formatted hack works.

Thanks Geert, and I guess we can add plain text to the list of things EA doesn't do very well...

/U
My theories are always correct, just apply them to the right reality.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13136
  • Karma: +547/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Unicode characters when selecting Note column
« Reply #4 on: February 06, 2020, 12:29:37 am »
Since version 15 they started to xml-escape special characters in the notes fields.

So if you now use a notes field from SQL in documents (or searches, or...) you have to treat it as it would contain formatted text.

Geert