Solved TD-4709: TD Source Code File Format --> UTF-8

Missing or incomplete OpenText Gupta product features? Discuss it here!
fakie

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by fakie » 01 Nov 2012, 20:05

I'm glad to hear that you are asking the dev. team about the enhancement for read/write of UTF-8 files!
At the moment we have to run a skript that converts all the files that have changed before commiting it in our source control.

I'm hoping this feature is going to be in one of the next SPs :-)

ggd

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by ggd » 23 Jan 2013, 11:12

An other thread I read "Source code in XML format for QRP". viewtopic.php?f=38&t=63164
"You said, during the devCon, that you wanted to store source code (.apt) in XML format in future versions."

This would solve our problem. If this xml would not be in utf16 coding. :?

fakie

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by fakie » 13 Nov 2013, 16:36

Saving the TeamDeveloper source code in XML format be very very very great!
Is this planned for future releases?

mlueling
Germany
Posts: 17
Joined: 03 Jul 2017, 11:57
Location: Wetter Germany

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by mlueling » 14 Nov 2013, 08:38

I also would like this feature very much. And I think you already use XML in TD Mobile, so please merge the feature to normal TD.

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3512
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by Dave Rabelink » 14 Nov 2013, 11:04

I wonder if XML would benefit us.
I guess the files will be unreadable when using text tools.

For instance, we use code review software which compares versions and show the changes.
They are already difficult to read when using the TEXT format. In INDENTED TEXT format it is better.

But when all code is in XML, any structure to view in tools other than the TD IDE will be impossible.

But add options to TD to specify the UNICODE format and possibly add an extra option to save in XML would give us a choice.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

fakie

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by fakie » 14 Nov 2013, 19:18

The XML would be better readable for other tools, written in Java or .NET.
Now we have to use the CDK-Libraries to do the parsing of the source code (or is there another way we haven't considered yet? :-)).
This would help for doing static code analysis and to assess the code quality..

Dave Rabelink
Founder/Site Admin
Founder/Site Admin
Netherlands
Posts: 3512
Joined: 24 Feb 2017, 09:12
Location: Gouda, The Netherlands

Re: TD-4709: TD Source Code File Format --> UTF-8

Post by Dave Rabelink » 24 Dec 2022, 08:36

This is an old thread but for the sake of refreshing the info on this topic:

This enhancement was implemented in TD 7.2.0.

Sources can be read and saved as UTF-8 from TD IDE.
(See settings in Preferences/General tab)

PrefsUtf8.png

The setting is managed in the registry (eg here for 7.4):

Code: Select all

Computer\HKEY_CURRENT_USER\SOFTWARE\Gupta\SQLWindows 7.4\Settings\PreferUTF8Encoding
Values:

0 - UTF16
1 - UTF8 For write
2 - UTF8 For read
3 - UTF8 For read/write


As from TD 7.3.0:

Added in CDK.apl:
BOOL CDKSetUTF8Option( int nLoadOrSave, BOOL bEnable )

This is CDK external function defined in cdkiXX.dll.
You can call this function anytime before loading/saving application by using UTF8 encoding.
This updates process global setting so that this is effective until end of process.

Parameters:
nLoadOrSave:
0 Enable or disable Save As UTF8 option
1 Enable or disable Read As UTF8 option
2 Enable or disable both options
bEnable: TRUE to enable specified option.

Return Value:
TRUE if successful, or FALSE if an error occurs.
PS: This CDK function does not change the registry setting but sets the value only for the running process.
This means using CDK to save application sources using SaveOutlineAsText can be dynamically switched between UTF8 and UTF16 by calling CDKSetUTF8Option before saving.


As from TD 7.3.5:
TD 7.3.5 now assumes that text application file saved with TD 7.2 and later version uses
UTF8 encoding if application file does not have BOM (Byte Order Mark) even though
"Use UTF-8 Encoding For Read" option is not set.
At the moment of writing (latest TD 7.4.5) there is an issue with CDKSetUTF8Option. It does not work at all:
viewtopic.php?f=26&t=73716

And a change request to have the handling of UTF8 in TD be improved:
viewtopic.php?f=41&t=73720
You do not have the required permissions to view the files attached to this post.
Regards,
Dave Rabelink

Image
Articles and information on Team Developer Tips & Tricks Wiki
Download samples, documents and resources from TD Sample Vault
Videos on TDWiki YouTube Channel

Return to “Enhancement suggestions”

Who is online

Users browsing this forum: [Ccbot] and 2 guests