[Scilab-Dev] Re: function AnsiToUTF and localeToUTF duplicate and conflict

Yung-Jang Lee yjlee123 at gmail.com
Sun Aug 10 05:19:46 CEST 2008


François  and all :

Yes, the message you response is more than a week old. It seems have
problems to delivery to ML during weekend.

Coding converting is quite complicate things for software like Scilab5.
C/C++/Java/TCL and Scilab language itself  all have their own  strategy to
handle encoding,  it need a standardization for code converting between
different context.


YungLee

2008/8/10 François Vogel <fvogelnew1 at free.fr>

> Hi,
>
> I have also noticed there seem to be some duplicates here and there.
>
> And more than what you're reporting: in ScilabEval.c for instance,
> conversion from UTF-8 to ANSI is performed by a function from the Tcl
> librayr (Tcl_UtfToExternal).
>
> Cleaning and standardization is needed, but maybe I'm coming after things
> were done (your message is more than a week old)?
>
> Francois
>
>
> Yung-Jang Lee said on 02/08/2008 18:31:
>
>> Hi,all:
>>
>> I have check that the results to call localeToUTF and ANSIToUTF8 are exact
>> the same in my machine. But for CP1252 encoding I don't convert to UTF
>> inside localeToUTF in current implementation (I thought CP1252 is a subset
>> of UNICODE).
>>
>> So, may be we can remove calling 'ANSIToUTF8' in 'printf_scilab' and let
>> 'localeToUTF' always perform convert even for CP1252 encoding.
>>
>> Or any suggections ?
>>
>> YungLee
>>
>>
>>
>> 2008/8/2 Yung-Jang Lee <yjlee123 at gmail.com <mailto:yjlee123 at gmail.com>>
>>
>>    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/20080810/96535904/attachment.htm>


More information about the dev mailing list