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).

    #[export(raw_return)]
    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


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

Reply via email to