I assumed (dangerous though it may be) that "leaves anything that isn't
UTF-16 unchanged" meant "don't convert any buffer to UTF-8 if the
origination buffer is not UTF-16".

SDR

On Thu, Sep 13, 2012 at 5:04 PM, David Given <[email protected]> wrote:

> On 13/09/12 21:08, Richard Hipp wrote:
> [...]
> > Basically, we need a routine that converts an in-memory buffer from
> > UTF16 to UTF8, and leaves anything that isn't UTF16 unchanged.  Then we
> > need to call that routine in a few strategic places inside of Fossil
>
> Could you clarify what you mean by 'leaves anything that isn't UTF-16
> unchanged'? Do you mean you just want it to convert up until the point
> where it finds non-well-formed UTF-16 and then tells you where it
> stopped, or do you actually want to leave the unconverted UTF-16 in the
> output file? Because that last will just produce gibberish ---
> non-well-formed UTF-8.
>
> The standard way to do all these conversions is just to call out to
> iconv, which handles all the horrible edge cases. It is available for
> Windows, but it's not small.
>
> OTOH if you don't care about the edge cases, converting well-formed
> UTF-16 to UTF-8 is lossless and pretty straightforward.
>
> --
> ┌─── dg@cowlark.com ───── http://www.cowlark.com ─────
> │
> │ life←{ ↑1 ⍵∨.^3 4=+/,¯1 0 1∘.⊖¯1 0 1∘.⌽⊂⍵ }
> │ --- Conway's Game Of Life, in one line of APL
>
>
> _______________________________________________
> fossil-users mailing list
> [email protected]
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
>
>
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to