[pve-devel] [PATCH v3 proxmox-perl-rs 24/66] add PVE::RS::Notify module

Lukas Wagner l.wagner at proxmox.com
Wed Jul 19 12:37:15 CEST 2023

On 7/19/23 12:23, Wolfgang Bumiller wrote:
>>> +    #[export(raw_return)]
>>> +    fn parse_config(
>>> +        #[raw] class: Value,
>>> +        raw_config: &str,
>>> +        raw_private_config: &str,
>> I half-suspect that using &[u8] here - since that's what perl *actually*
>> gives us if we just read the data out of files without setting the mode
>> to 'utf8' or anything - might just fix the emoji issues.
>> Alternatively, perl would have to actually declare an encoding ;-)
> Though ultimately the alter patches will probably need to do the same
> for things where utf-8 matters (at least the comments).

     fn parse_config(
         #[raw] class: Value,
         raw_config: &[u8],
         raw_private_config: &[u8],
     ) -> Result<Value, Error> {
         let raw_config = std::str::from_utf8(raw_config)?;
         let raw_private_config = std::str::from_utf8(raw_private_config)?;

This seems to have done the trick. The `update` calls do not seem to need it,
it appears to work fine with just this modification.

Thanks a lot!

- Lukas

More information about the pve-devel mailing list