# How to insert Text with with non-english characters

**URL:** <https://forum.techsoft3d.com/t/how-to-insert-text-with-with-non-english-characters/1492>\
**Category:** HOOPS Visualize Desktop\
**Tags:** code, knowledge-base, how-to\
**Created:** [July 12, 2022, 4:00am UTC](https://forum.techsoft3d.com/t/how-to-insert-text-with-with-non-english-characters/1492 "2022-07-12T04:00:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gabriel.peragine](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/gabriel.peragine/32/1535_2.png) [@gabriel.peragine](https://forum.techsoft3d.com/u/gabriel.peragine)\
**Post date:** [July 12, 2022, 4:00am UTC](https://forum.techsoft3d.com/t/how-to-insert-text-with-with-non-english-characters/1492/1 "2022-07-12T04:00:00Z")

</div>

When you define a Text element using UTF-8 characters, be sure to include a compatible font.

e.g.

```auto

void CHPSView::OnUserCode3()
{

	auto segKey = GetCanvas().GetFrontView().GetAttachedModel().GetSegmentKey();

	TextKit tk1; //font set
	tk1.SetFont("Yu Gothic");
	tk1.SetText("こんにちは");
	tk1.SetPosition(Point(0, 0, 0));
	segKey.InsertText(tk1);
	
	TextKit tk2; //font not set
	tk2.SetText("こんにちは");
	tk2.SetPosition(Point(0, 5, 0));
	segKey.InsertText(tk2);

}

```

 ![76c72c1f-9454-46bf-a64c-d70aad59e9cd](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/7a9ad2f2493352a3dcdfc69f67a7bdee1da0baa4.png)

⚠ Note: for this code sample to work, you need to make sure the CPP file is encoded in UTF-8 **without** BOM.

This code sample insert a japanese text and uses the default Yu Gothic font to display it.

On Windows, this is the list of default font available for the different characters sets: [![](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/1X/dfb60906a745fc605b3e15bd57489aea225d4815.png)Font List Windows 10 - Typography](https://docs.microsoft.com/en-us/typography/fonts/windows_10_font_list)
