### Godot version

4.0.dev Beta 14

### System information

Windows 10 and Linux (Pop!_OS 22.04)

### Issue description

When opening a UTF-8 text file with an emoji or other unicode character, the line will not show up and the editor starts producing a number of errors in output. Here is the output:

--- GDScript language server started ---
  U_ILLEGAL_ARGUMENT_ERROR
  modules/text_server_adv/text_server_adv.cpp:4389 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5829 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  U_ILLEGAL_ARGUMENT_ERROR
  modules/text_server_adv/text_server_adv.cpp:4389 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()

### Steps to reproduce

Add a text file and paste in an emoji into the text resource file then open it in the editor.

### Minimal reproduction project

[FileIOGuide.zip](https://github.com/godotengine/godot/files/10477742/FileIOGuide.zip)

}
		}
	}
	return true;
}
TextServerAdvanced::TextServerAdvanced() {
	_insert_num_systems_lang();
	_insert_feature_sets();
	_bmp_create_font_funcs();
}
up() {
	for (const KeyValue<SystemFontKey, SystemFontCache> &E : system_fonts) {
		const Vector<SystemFontCacheRec> &sysf_cache = E.value.var;
		for (const SystemFontCacheRec &F : sysf_cache) {
			_free_rid(F.rid);
		}
	}
	system_fonts.clear();
	system_font_data.clear();
}
TextServerAdvanced::~TextServerAdvanced() {
	_bmp_free_font_funcs();
#ifdef MODULE_FREETYPE_ENABLED
	if (ft_library != nullptr) {
		FT_Done_FreeType(ft_library);
	}
#endif
	u_cleanup();
}