Mercurial > octave
diff liboctave/wrappers/uniconv-wrappers.c @ 30822:0826c503f294
Encoding facet based on gnulib uniconv for STL iostreams (bug #61839).
* liboctave/util/oct-string.h, liboctave/util/oct-string.cc (codecvt_u8): Add
encoding facet based on gnulib uniconv for STL iostreams.
* liboctave/wrappers/uniconv-wrappers.h, liboctave/wrappers/uniconv-wrappers.c
(octave_u8_conv_from_encoding_offsets, octave_u8_conv_to_encoding_offsets): Add
new wrappers.
* libinterp/corefcn/oct-stream.h, libinterp/corefcn/oct-stream.cc
(octave::stream): Wrap output stream with encoding facet.
* libinterp/corefcn/utils.h, libinterp/corefcn/utils.cc (format, vformat):
Remove functions that are no longer needed.
* libinterp/corefcn/file-io.cc: Add BIST.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Sat, 05 Mar 2022 21:20:58 +0100 |
parents | 796f54d4ddbf |
children | 597f3ee61a48 |
line wrap: on
line diff
--- a/liboctave/wrappers/uniconv-wrappers.c Sun Mar 06 18:20:05 2022 -0800 +++ b/liboctave/wrappers/uniconv-wrappers.c Sat Mar 05 21:20:58 2022 +0100 @@ -72,6 +72,24 @@ src, srclen, NULL, NULL, lengthp); } +uint8_t * +octave_u8_conv_from_encoding_offsets + (const char *fromcode, const char *src, size_t srclen, + size_t *offsets, size_t *lengthp) +{ + return u8_conv_from_encoding (fromcode, iconveh_question_mark, + src, srclen, offsets, NULL, lengthp); +} + +char * +octave_u8_conv_to_encoding_offsets + (const char *tocode, const uint8_t *src, size_t srclen, + size_t *offsets, size_t *lengthp) +{ + return u8_conv_to_encoding (tocode, iconveh_question_mark, + src, srclen, offsets, NULL, lengthp); +} + char * u8_from_wchar (const wchar_t *wc) {