File tree Expand file tree Collapse file tree 5 files changed +24
-1
lines changed
include/godot_cpp/classes Expand file tree Collapse file tree 5 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ public:
250250 } \
251251 \
252252 static const ::godot::StringName &get_class_static () { \
253- static const ::godot::StringName string_name = ::godot::StringName (# m_class); \
253+ static const ::godot::StringName string_name = ::godot::StringName (U## # m_class); \
254254 return string_name; \
255255 } \
256256 \
Original file line number Diff line number Diff line change @@ -276,6 +276,10 @@ func _ready():
276276 assert_equal (library_path , ProjectSettings .globalize_path (library_path ))
277277 assert_equal (FileAccess .file_exists (library_path ), true )
278278
279+ # Test a class with a unicode name.
280+ var przyk ład = ExamplePrzyk ład .new ()
281+ assert_equal (przyk ład .get_the_word (), "słowo to przykład" )
282+
279283 exit_with_status ()
280284
281285func _on_Example_custom_signal (signal_name , value ):
Original file line number Diff line number Diff line change @@ -736,3 +736,11 @@ ExampleRuntime::ExampleRuntime() {
736736
737737ExampleRuntime::~ExampleRuntime () {
738738}
739+
740+ void ExamplePrzykład::_bind_methods() {
741+ ClassDB::bind_method (D_METHOD (" get_the_word" ), &ExamplePrzykład::get_the_word);
742+ }
743+
744+ String ExamplePrzykład::get_the_word() const {
745+ return U" słowo to przykład" ;
746+ }
Original file line number Diff line number Diff line change @@ -273,4 +273,14 @@ class ExampleRuntime : public Node {
273273 ~ExampleRuntime ();
274274};
275275
276+ class ExamplePrzyk ład : public RefCounted {
277+ GDCLASS (ExamplePrzykład, RefCounted);
278+
279+ protected:
280+ static void _bind_methods ();
281+
282+ public:
283+ String get_the_word () const ;
284+ };
285+
276286#endif // EXAMPLE_CLASS_H
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
3030 GDREGISTER_CLASS (ExampleBase);
3131 GDREGISTER_CLASS (ExampleChild);
3232 GDREGISTER_RUNTIME_CLASS (ExampleRuntime);
33+ GDREGISTER_CLASS (ExamplePrzykład);
3334}
3435
3536void uninitialize_example_module (ModuleInitializationLevel p_level) {
You can’t perform that action at this time.
0 commit comments