@@ -319,20 +319,12 @@ nk_sdl_clipboard_paste(nk_handle usr, struct nk_text_edit *edit)
319319 char * text ;
320320 int len ;
321321 NK_UNUSED (usr );
322-
323322 /* this function returns empty string on failure, not NULL */
324323 text = SDL_GetClipboardText ();
325324 NK_ASSERT (text );
326325
327326 if (text [0 ] != '\0' ) {
328- /* FIXME: there is a bug in Nuklear that affects UTF8 clipboard handling
329- * "len" should be a buffer length, but due to bug it must be a glyph count
330- * see: https://github.com/Immediate-Mode-UI/Nuklear/pull/841 */
331- #if 0
332327 len = nk_strlen (text );
333- #else
334- len = SDL_utf8strlen (text );
335- #endif
336328 nk_textedit_paste (edit , text , len );
337329 }
338330 SDL_free (text );
@@ -341,27 +333,14 @@ nk_sdl_clipboard_paste(nk_handle usr, struct nk_text_edit *edit)
341333NK_INTERN void
342334nk_sdl_clipboard_copy (nk_handle usr , const char * text , int len )
343335{
344- const char * ptext ;
345336 char * str ;
346337 size_t buflen ;
347338 int i ;
348339 struct nk_sdl * sdl = (struct nk_sdl * )usr .ptr ;
349340 NK_ASSERT (sdl );
350341 if (len <= 0 || text == NULL ) return ;
351342
352- /* FIXME: there is a bug in Nuklear that affects UTF8 clipboard handling
353- * "len" is expected to be a buffer length, but due to bug it actually is a glyph count
354- * see: https://github.com/Immediate-Mode-UI/Nuklear/pull/841 */
355- #if 0
356343 buflen = len + 1 ;
357- NK_UNUSED (ptext );
358- #else
359- ptext = text ;
360- for (i = len ; i > 0 ; i -- )
361- (void )SDL_StepUTF8 (& ptext , NULL );
362- buflen = (size_t )(ptext - text ) + 1 ;
363- #endif
364-
365344 str = sdl -> allocator .alloc (sdl -> allocator .userdata , 0 , buflen );
366345 if (!str ) return ;
367346 SDL_strlcpy (str , text , buflen );
0 commit comments