Feature request - XML Encoding

ertank
Posts: 61
Joined: 06.06.2021 21:56

Feature request - XML Encoding

Post by ertank »

Hello,

Some XML files have a line as the first line of the file that indicates the XML encoding

Code: Select all

<?xml version="1.0" encoding="ISO-8859-9"?>
Is it possible to set encoding using this information?

Thank you for your consideration.

Regards,
Ertan
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

Lazarus supports these ISO encodings
iso-8859-1
iso-8859-2
iso-8859-15
but it missed your case iso-8859-9. maybe sometimes one appears who will add 'your case' too.
yes I know that you suggest to parse XML line, but it's no help now.

wikipedia https://en.wikipedia.org/wiki/ISO/IEC_8859-9

>>It is designated ECMA-128 by Ecma International and TS 5881 as a Turkish standard.

so I suggest that some Turkish man adds the Lazarus patch.
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

just added ISO-8859-9 (Turkish encoding) to CudaText.
please test that it works ok:
beta 1.157.0.1 (note: .1 at the end) here
http://uvviewsoft.com/c/

later I will try to parse that XML line and detect the encoding.
ertank
Posts: 61
Joined: 06.06.2021 21:56

Post by ertank »

Just had the chance to update my CudaText version to 1.158.2.0
What I see is ISO-8859-9 seems fine to me.

Thanks.
Attachments
image_2022-03-18_215900.png
ertank
Posts: 61
Joined: 06.06.2021 21:56

Post by ertank »

main Alexey wrote:just added ISO-8859-9 (Turkish encoding) to CudaText.
Thank you for that. So far, I did not encounter any problem. I can say it is working.
main Alexey wrote:later I will try to parse that XML line and detect the encoding.
I appreciate if you can find time to do that.

Thanks & Regards,
Ertan
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

Test how it works in the beta,
http://uvviewsoft.com/c/
ertank
Posts: 61
Joined: 06.06.2021 21:56

Post by ertank »

All XML files (about 6 different files) I tested with ISO-8859-9 encoding works just fine.
I made an UTF8 encoded XML file, copied it to a different name just to make it a newly opened file for CudaText and that file is also correctly opened as UTF8 encoding.

Thank you
ertank
Posts: 61
Joined: 06.06.2021 21:56

Post by ertank »

I just got another XML with below encoding which to my knowledge is identical to ISO8859-9

Code: Select all

<?xml version="1.0" encoding="Windows-1254"?>
This encoding is mapping to cp1254 in CudaText as to my knowledge. I wonder if it is possible to add it in auto encoding setting of XML files.

I could not check cp1254 encoding as I failed to change encoding of auto encoded XML file
Attached is a small video to explain what I mean. This is version 1.161.0.0 win64-x86_64 version I am using.

Thanks & Regards,
Ertan
Attachments
encoding not changing.7z
Encoding not changing
(609.49 KiB) Downloaded 62 times
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

Maybe send me the small sample file, so I can check it here.
email: support (at) uvviewsoft.com

Maybe UTF8 takes precedence over cp1254..
main Alexey
Posts: 2245
Joined: 25.08.2021 18:15

Post by main Alexey »

I repeat my reply from email.
I tested your file and _clean_ Cud opens it in cp1254. Not utf8. Can you pls test on _clean Cud_? if no problem there, add your plugins, 1 by 1, and see again.
Post Reply