• Re: UTF16 <-> UTF32

    From Chris Ahlstrom@21:1/5 to Bonita Montero on Sun Sep 1 10:07:35 2024
    Bonita Montero wrote this copyrighted missive and expects royalties:

    Today I needed conversion functions from UTF32 to UTF16 and in the
    opposite direction. I wanted to allow result-string re-usage and
    decided to give the result string as a reference-parameter. This
    would help the result string to keep its capacity.
    I think there's no way to implement that code faster.

    <snip>

    Here's a method adopted from the Fluxbox window manager project:

    https://github.com/ahlstromcj/potext/blob/master/library/src/po/iconvert.cpp

    It uses iconv(3). No warranty implied.

    --
    It seemed the world was divided into good and bad people. The good ones slept better... while the bad ones seemed to enjoy the waking hours much more.
    -- Woody Allen, "Side Effects"

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)