Archived

This forum has been archived. Please start a new discussion on GitHub.

Bad encoding error in slice2cpp and slice2cs

Hi, I'm trying ice3.6.2 in my projects. When I compiling a simple slice file with slice2cpp and slice2cs on a machine running windows10, following error come out: error:StringConverter.cpp:419: IceUtil::IllegalConversionException: bad encoding.
When I trying to compile the official demos, the same error comes out.
But, when I trying to do the same thing on another machine also running windows 10, everything is ok.
I hope someone tell me what could cause this error.
Thank you!
Regards

Dingding

Comments

  • xdm
    xdm La Coruña, Spain

    Hi,

    One thing comes to mind is that the Slice files are containing in some directory with non UTF-8 characters in the machine where things fail.

    The only workaround is to use only ASCII characters in the build path and file names.

    We will consider to improve this in the next release to avoid this limitation.

  • Thanks for advices.
    But my problem is not solved still. My slice file for test is very simple, as show below:

    module Demo{

    struct InPara{
        string strPara;
        long lPara;
    };
    
    struct OutPara{
        string strPara;
        long lPara;
    };
    
    interface DemoServer{
        OutPara DemoFun(InPara para);
    };
    

    };

    This slice file just uses only ASCII characters, its path is G:\testprojects\vsicedemo\demo.ice

    And the installation path of ice official demos is G:\Ice-3.6.2-demos , but the same error appeared.

  • xdm
    xdm La Coruña, Spain

    Hi,

    After review our code, I think this could be an issue with the temporary files created by Slice compilers.

    what is the value of TMP environment variable in the machine where things are failing? and what is the Windows code page on this machine?

  • Thanks for reply.
    The value of TMP environment variable in the machine is C:\Windows\Temp, and the Windows code page is 936 (Simplified Chinese GBK).

  • xdm
    xdm La Coruña, Spain

    Hi,

    You can try to build Ice from our 3.6 branch, I have pushed a fix for a related issue but it is not clear if it is the same that is affecting you.

    In any case a debug build will give us a bit more info. Check our build instructions to build the sources.