Echo-ing unicode character

后端 未结 1 1373
余生分开走
余生分开走 2021-01-16 05:55

I would like to echo the unicode character \"é\" in cmd via running bat file. I prepared a short script:

@echo off
SET message=Gép3
echo %message%
pause


        
相关标签:
1条回答
  • 2021-01-16 06:35

    Do this (both are important):

    • Use code page 65001 (UTF-8) chcp 65001
    • When you save your .bat file, use UTF-8

    i. e. edit your example code in this way:

    @echo off
    chcp 65001
    SET message=Gép3
    echo %message%
    pause
    

    Again, it is important that you save your .bat file with encoding UTF-8

    0 讨论(0)
提交回复
热议问题