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
signature.asc
Description: OpenPGP digital signature
_______________________________________________ fossil-users mailing list [email protected] http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

