On 17-Jan-2025 22:35, Christian Brabandt wrote:
On Wed, 15 Jan 2025, 'John Marriott' via vim_dev wrote:

On 15-Jan-2025 03:45, Christian Brabandt wrote:
patch 9.1.1016: Not possible to convert string2blob and blob2string

Commit:https://github.com/vim/vim/commit/1aefe1de0b20fe4966863e07efa14b6aa87323ee
Author: Yegappan Lakshmanan<yegap...@yahoo.com>
Date:   Tue Jan 14 17:29:42 2025 +0100

      patch 9.1.1016: Not possible to convert string2blob and blob2string
      Problem:  Not possible to convert string2blob and blob2string
      Solution: add support for the blob2str() and str2blob() functions
      closes: #16373
      Signed-off-by: Yegappan Lakshmanan<yegap...@yahoo.com>
      Signed-off-by: Christian Brabandt<c...@256bit.org>


That seems to return a potential invalid string however. I wonder what
is the reason for the  #ifdefs in `utf_valid_string()` at all? It seems this 
patch
would be better, no?

```
diff --git a/src/mbyte.c b/src/mbyte.c
index 157018266..a8819d992 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -4355,7 +4355,6 @@ theend:
      convert_setup(&vimconv, NULL, NULL);
  }

-#if defined(FEAT_GUI_GTK) || defined(FEAT_SPELL) || defined(PROTO)
  /*
   * Return TRUE if string "s" is a valid utf-8 string.
   * When "end" is NULL stop at the first NUL.  Otherwise stop at "end".
@@ -4380,7 +4379,6 @@ utf_valid_string(char_u *s, char_u *end)
      }
      return TRUE;
  }
-#endif

  #if defined(FEAT_GUI) || defined(PROTO)
  /*
```



Thanks,
Christian
Hi Christian,

I reckon you're right. I don't see any reason for that function to be included conditionally.

Cheers
John

--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- You received this message because you are subscribed to the Google Groups "vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/f1adb813-5313-4b33-9e70-20e565d1cbf5%40internode.on.net.

Raspunde prin e-mail lui