lightmap Posted November 18, 2019 Share Posted November 18, 2019 Hello I'm trying to render string, but get only boxes instead chars and here what it draws in manual no converters for string available https://developer.unigine.com/en/docs/2.9/api/library/common/class.string only for c++ and no c# how to render it correctly? Link to comment
silent Posted November 18, 2019 Share Posted November 18, 2019 (edited) lightmap Please, make sure that your source file is encoded in UTF-8 without BOM and you have added pragma at the beginning of the file: #pragma execution_character_set("utf-8") // C++ UPD for C# For C# you need to convert string (no pragma is required): Encoding.Default.GetString(Encoding.UTF8.GetBytes("test тест")) // C# No conversions will required starting with 2.10 SDK update, you can simply write code like this and it will work: Log.message("Привет!\n"); // 2.10 and further :) Thanks! Edited November 18, 2019 by silent 2 How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
lightmap Posted November 18, 2019 Author Share Posted November 18, 2019 #pragma seems work only for c++ and not for c# I'm using c# 4.8, and as I can see in lister the source file has utf8 encoding Link to comment
silent Posted November 18, 2019 Share Posted November 18, 2019 Edited my previous post (added C# example). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
Recommended Posts