How do I use accented characters in the window title in SDL2?

感情迁移 提交于 2020-07-08 14:56:53

问题


SDL_Window* window = SDL_CreateWindow(
    "Capítulo 1",
    SDL_WINDOWPOS_CENTERED,
    SDL_WINDOWPOS_CENTERED,
    640,
    480,
    SDL_WINDOW_SHOWN
);

The displayed title is Cap?tulo 1


回答1:


I run into the same problem in Windows with Japanese letters.

Using UTF-8 string literals works for me:

SDL_Window* window = SDL_CreateWindow(
    u8"Capítulo 1",
    SDL_WINDOWPOS_CENTERED,
    SDL_WINDOWPOS_CENTERED,
    640,
    480,
    SDL_WINDOW_SHOWN
);


来源:https://stackoverflow.com/questions/53741550/how-do-i-use-accented-characters-in-the-window-title-in-sdl2

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!