function AnsiToUTF and localeToUTF duplicate and conflict

Yung-Jang Lee yjlee123 at gmail.com
Sat Aug 2 15:45:13 CEST 2008


Hi, all :

In recent  SVN trunk, I found a new files windows_tools*\charEncodings.c
that have functions for encoding convert and this is conflicted  with
function in file locazilation*\localetoutf.c .  Function ANSIToUTF8 (defined
in charEncodings.c ) is used  in printf_scilab :


-----------------------sciprint.c---------------------------------------
void printf_scilab(char *buffer,BOOL withDiary)
{
    if (buffer)
    {
        if (getScilabMode() == SCILAB_STD)
        {
            #ifdef _MSC_VER
            {
                char *UTF8Buffer = ANSIToUTF8(buffer);//<--------
                if (UTF8Buffer)
                {
                    ConsolePrintf(UTF8Buffer);
//<------------------------- call localeToUTF inside ConsolePrintf
                    FREE(UTF8Buffer);
                }
-------------------------------------------------------------------------------

On my machine (WINDOW/XP,CP950) , conversion to UTF strings is thus
performed twice, and this make console fail to display chinese again.

I think functions in files 'charEncodings.c' and 'localetoutf.c'  should
merged and the encoding transformation need some agreements between
developers.

YungLee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/dev/attachments/20080802/08ce9f3a/attachment.htm>


More information about the dev mailing list