public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* Re: [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm
@ 2024-10-13 10:26 James Brown via pve-devel
  0 siblings, 0 replies; 3+ messages in thread
From: James Brown via pve-devel @ 2024-10-13 10:26 UTC (permalink / raw)
  To: Andrew via pve-devel; +Cc: James Brown

[-- Attachment #1: Type: message/rfc822, Size: 7712 bytes --]

From: "James Brown" <randomvoidmail@foxmail.com>
To: "Andrew via pve-devel" <pve-devel@lists.proxmox.com>
Subject: Re: [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm
Date: Sun, 13 Oct 2024 18:26:43 +0800
Message-ID: <tencent_DB84E383BD2F5E1012CFF0A56CC9FC44DA05@qq.com>

Do you mean if I operate this within the ESXi file reading sub block then it would be fine?


How about putting these lines on top of /usr/share/perl5/PVE/Storage/ESXiPlugin.pm?


Or just within "get_manifest" and&nbsp; "get_import_metadata" sub blocks in ESXiPlugin.pm?



---Original---
From: "Thomas Lamprecht"<t.lamprecht@proxmox.com&gt;
Date: Wed, Oct 9, 2024 14:10 PM
To: "James Brown"<randomvoidmail@foxmail.com&gt;;"pve-devel"<pve-devel@lists.proxmox.com&gt;;
Subject: Re: [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm


Am 09/10/2024 um 02:45 schrieb James Brown:
&gt; From 8ed0c20251c464a058ea08872bc7d54f6701d912 Mon Sep 17 00:00:00 2001
&gt; From: James Brown <randomvoidmail@foxmail.com&gt;
&gt; Date: Wed, 9 Oct 2024 08:40:10 +0800
&gt; Subject: [PATCH] Add UTF8 encoding
&gt; 

Please provide some actual commit message for why this is done, and evaluating
the actual fall out of the change.

&gt; ---
&gt; &nbsp;src/PVE/Tools.pm | 4 ++++
&gt; &nbsp;1 file changed, 4 insertions(+)
&gt; 
&gt; 
&gt; diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
&gt; index bd305bd..cf86a0e 100644
&gt; --- a/src/PVE/Tools.pm
&gt; +++ b/src/PVE/Tools.pm
&gt; @@ -3,6 +3,10 @@ package PVE::Tools;
&gt; &nbsp;use strict;
&gt; &nbsp;use warnings;

the patch is broken, please submit it with a mail user agent that does not
messes with whitespace, if in doubt use git send-email [0].

[0]: https://git-send-email.io/
 
&gt; +use open qw(:std :utf8);

that can have lots of fallout, or did you check all sites using PVE::Tools and
opening files to ensure that all definitively will write valid UTF-8 only?

&gt; +use Encode qw(decode_utf8);
&gt; +@ARGV = map { decode_utf8($_, 1) } @ARGV;

why are you re-encoding the system argument list in some library module?!
That is really a no-go, this must stay in the control of the actual executable.

&gt; +
&gt; &nbsp;use Date::Format qw(time2str);
&gt; &nbsp;use Digest::MD5;
&gt; &nbsp;use Digest::SHA;
&gt; --
&gt; 2.34.1

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm
       [not found] <tencent_A1C4A34146193A960D99A3486B70D4B0370A@qq.com>
@ 2024-10-09  6:10 ` Thomas Lamprecht
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Lamprecht @ 2024-10-09  6:10 UTC (permalink / raw)
  To: James Brown, pve-devel

Am 09/10/2024 um 02:45 schrieb James Brown:
> From 8ed0c20251c464a058ea08872bc7d54f6701d912 Mon Sep 17 00:00:00 2001
> From: James Brown <randomvoidmail@foxmail.com&gt;
> Date: Wed, 9 Oct 2024 08:40:10 +0800
> Subject: [PATCH] Add UTF8 encoding
> 

Please provide some actual commit message for why this is done, and evaluating
the actual fall out of the change.

> ---
> &nbsp;src/PVE/Tools.pm | 4 ++++
> &nbsp;1 file changed, 4 insertions(+)
> 
> 
> diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
> index bd305bd..cf86a0e 100644
> --- a/src/PVE/Tools.pm
> +++ b/src/PVE/Tools.pm
> @@ -3,6 +3,10 @@ package PVE::Tools;
> &nbsp;use strict;
> &nbsp;use warnings;

the patch is broken, please submit it with a mail user agent that does not
messes with whitespace, if in doubt use git send-email [0].

[0]: https://git-send-email.io/
 
> +use open qw(:std :utf8);

that can have lots of fallout, or did you check all sites using PVE::Tools and
opening files to ensure that all definitively will write valid UTF-8 only?

> +use Encode qw(decode_utf8);
> +@ARGV = map { decode_utf8($_, 1) } @ARGV;

why are you re-encoding the system argument list in some library module?!
That is really a no-go, this must stay in the control of the actual executable.

> +
> &nbsp;use Date::Format qw(time2str);
> &nbsp;use Digest::MD5;
> &nbsp;use Digest::SHA;
> --
> 2.34.1



_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm
@ 2024-10-09  0:45 James Brown via pve-devel
  0 siblings, 0 replies; 3+ messages in thread
From: James Brown via pve-devel @ 2024-10-09  0:45 UTC (permalink / raw)
  To: pve-devel; +Cc: James Brown

[-- Attachment #1: Type: message/rfc822, Size: 6028 bytes --]

From: "James Brown" <randomvoidmail@foxmail.com>
To: pve-devel <pve-devel@lists.proxmox.com>
Subject: [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm
Date: Wed, 9 Oct 2024 08:45:24 +0800
Message-ID: <tencent_A1C4A34146193A960D99A3486B70D4B0370A@qq.com>

From 8ed0c20251c464a058ea08872bc7d54f6701d912 Mon Sep 17 00:00:00 2001
From: James Brown <randomvoidmail@foxmail.com&gt;
Date: Wed, 9 Oct 2024 08:40:10 +0800
Subject: [PATCH] Add UTF8 encoding


---
&nbsp;src/PVE/Tools.pm | 4 ++++
&nbsp;1 file changed, 4 insertions(+)


diff --git a/src/PVE/Tools.pm b/src/PVE/Tools.pm
index bd305bd..cf86a0e 100644
--- a/src/PVE/Tools.pm
+++ b/src/PVE/Tools.pm
@@ -3,6 +3,10 @@ package PVE::Tools;
&nbsp;use strict;
&nbsp;use warnings;


+use open qw(:std :utf8);
+use Encode qw(decode_utf8);
+@ARGV = map { decode_utf8($_, 1) } @ARGV;
+
&nbsp;use Date::Format qw(time2str);
&nbsp;use Digest::MD5;
&nbsp;use Digest::SHA;
--
2.34.1

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-10-13 10:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-10-13 10:26 [pve-devel] [PATCH] Patch for UTF8 encoding in Tools.pm James Brown via pve-devel
     [not found] <tencent_A1C4A34146193A960D99A3486B70D4B0370A@qq.com>
2024-10-09  6:10 ` Thomas Lamprecht
  -- strict thread matches above, loose matches on Subject: below --
2024-10-09  0:45 James Brown via pve-devel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal