简体   繁体   English

在sfml中使用UTF8

[英]using UTF8 in sfml

I am trying to create something with SFML. 我正在尝试使用SFML创建一些东西。

I want to detect what character does the user type and to store it into a variable. 我想检测用户键入什么字符并将其存储到变量中。 Then I want to display it with the sf::Text. 然后我想用sf :: Text显示它。 It sounds easy but I want to use cyrillic. 听起来很简单,但我想使用西里尔文。

There is a whole paragraph called 有整段叫做

How to avoid problems with non-ASCII characters? 如何避免非ASCII字符出现问题?

in the tutorials section of SFML on Texts and fonts ( Click here to get there ). 在SFML的有关文本和字体的教程部分中( 单击此处到达此处 )。

When you follow it, you should be fine. 当您遵循它时,您应该会很好。

The sf::String class accepts both UNICODE and ANSI texts as constructor parameters, so you should be fine whatever input you get. sf :: String类将UNICODE和ANSI文本都接受为构造函数参数,因此无论输入内容如何,​​都应该没问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM