FLTK logo

Re: [fltk/fltk] Docs for fl_utf8*() functions could use some code examples (#125)

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.issues  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: [fltk/fltk] Docs for fl_utf8*() functions could use some code examples (#125) Albrecht Schlosser Nov 29, 2020  
 

@RokerHRO You wrote:

A char with value 0 in an UTF-8 string represents the Unicode character U+0000 and is nothing special at all. Yes, the NUL char is used in C as "string terminator" (and is considered as not part of the string) but that's a C thing, not a Unicode thing. If you have a C++ std::string than NUL char's in it are completely okay.

Unicode U+0000 is equivalent to ASCII NUL and one major feature of the UTF-8 encoding is that it is ASCII compatible, i.e. "old code" that was written to use ASCII only can still be used with UTF-8 encoding. In this Wikipedia article on UTF-8 you can read:

ASCII NUL characters can be used to split UTF-8-encoded data into null-terminated strings.

Can you give references that prove your point?

PS: "If you have a C++ std::string than NUL char's in it are completely okay." does IMHO not mean that C Strings with Unicode text in UTF-8 encoding (as used throughout FLTK) can not be terminated by NUL bytes. FLTK has both options in some functions: you can either specify a string and its length or only a string which must be NUL terminated. The latter can contain NUL bytes.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.