# Activiz 9.1 display chinese

**URL:** https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713
**Category:** Support
**Created:** [June 13, 2022, 7:47am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713 "2022-06-13T07:47:34Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![a772485252](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a772485252/32/5327_2.png) [@a772485252](https://discourse.vtk.org/u/a772485252)
#### Post date: [June 13, 2022, 7:47am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/1 "2022-06-13T07:47:34Z")

</div>

When I use vtkTextActor to display Chinese, the Chinese string is converted to utf8 and then to string, but the conversion fails for odd numbers. So, how to display odd numbers of Chinese in c#?  
vtkTextActor actor = new vtkTextActor();  
actor.GetTextProperty().SetFontFamily(4);  
actor.GetTextProperty().SetFontFile(@“C:\Windows\Fonts\simkai.ttf”);  
actor.GetTextProperty().SetFontSize(20);

```
        byte[] bytes = Encoding.UTF8.GetBytes("我");
        string s = Encoding.Default.GetString(bytes);
        actor.SetInput(s);
```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.vtk.org/user_avatar/discourse.vtk.org/mwestphal/32/19_2.png) [@mwestphal](https://discourse.vtk.org/u/mwestphal)
#### Post date: [June 13, 2022, 7:49am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/2 "2022-06-13T07:49:11Z")

</div>

@LucasGandel

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [June 13, 2022, 11:46pm UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/4 "2022-06-13T23:46:52Z")

</div>

Unless there has been a recent change Activiz does not support conversion of c# strings to utf8 for proper handling of text in VTK. That means Activiz can only work with plain English text.

---

<div class="post-metadata">

### Author: ![a772485252](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a772485252/32/5327_2.png) [@a772485252](https://discourse.vtk.org/u/a772485252)
#### Post date: [June 14, 2022, 2:14am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/5 "2022-06-14T02:14:37Z")

</div>

😭

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [June 14, 2022, 2:16am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/6 "2022-06-14T02:16:48Z")

</div>

You might prefer to use the Java or Python wrappers which handle the text conversion properly.

---

<div class="post-metadata">

### Author: ![a772485252](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a772485252/32/5327_2.png) [@a772485252](https://discourse.vtk.org/u/a772485252)
#### Post date: [June 14, 2022, 2:24am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/7 "2022-06-14T02:24:03Z")

</div>

But our application is developed based on WPF. Should I use activiz for the 3D module? Or should 3D be done in c++? It seems that everyone uses the c++ version to make 3D. And there is no problem for c++ to display Chinese. I am a little troubled.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [June 14, 2022, 2:29am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/8 "2022-06-14T02:29:16Z")

</div>

In that case I suggest you utilise C++ for the 3D module as well. Because VTK uses utf8 internally there are no problems displaying non-English text.

---

<div class="post-metadata">

### Author: ![a772485252](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a772485252/32/5327_2.png) [@a772485252](https://discourse.vtk.org/u/a772485252)
#### Post date: [June 14, 2022, 2:31am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/9 "2022-06-14T02:31:55Z")

</div>

Well, thank you very much for your reply！

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [June 14, 2022, 2:50am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/10 "2022-06-14T02:50:09Z")

</div>

As far as Activiz goes, I raised the issue about it not supporting utf8 here [Introduction to ActiViz Webinar - #8 by toddy](https://discourse.vtk.org/t/introduction-to-activiz-webinar/3396/8) and, two years later, nothing has been done.

It is actually not difficult to fix.

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [June 14, 2022, 7:06am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/11 "2022-06-14T07:06:26Z")

</div>

Nothing should be required on the Activiz side if you make sure your C# application is using UTF-8 characters only.  
To do so, force the active codepage to UTF-8 by adding the following section in your app.manifest file:

```auto
  <application xmlns="urn:schemas-microsoft-com:asm.v3">
    <windowsSettings>
      <activeCodePage xmlns="http://schemas.microsoft.com/SMI/2019/WindowsSettings">UTF-8</activeCodePage>
    </windowsSettings>
  </application>

```

Using the above with the code you provided displays the chinese character just fine.

---

<div class="post-metadata">

### Author: ![toddy](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/t/edb3f5/32.png) [@toddy](https://discourse.vtk.org/u/toddy)
#### Post date: [June 14, 2022, 9:10am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/12 "2022-06-14T09:10:29Z")

</div>

With the proviso that you can only deploy to Windows 10 machines.

---

<div class="post-metadata">

### Author: ![a772485252](https://discourse.vtk.org/user_avatar/discourse.vtk.org/a772485252/32/5327_2.png) [@a772485252](https://discourse.vtk.org/u/a772485252)
#### Post date: [June 14, 2022, 9:25am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/13 "2022-06-14T09:25:19Z")

</div>

By the way, who should I contact if I want to buy genuine activiz? And about invoice reimbursement. Failed to send the contact information on the official website all the time.

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [June 14, 2022, 11:23am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/15 "2022-06-14T11:23:23Z")

</div>

Sorry for not introducing myself, I’m the main maintainer of ActiViz.  
I will contact you by email to provide all the information. Thanks

---

<div class="post-metadata">

### Author: ![LucasGandel](https://discourse.vtk.org/user_avatar/discourse.vtk.org/lucasgandel/32/1831_2.png) [@LucasGandel](https://discourse.vtk.org/u/LucasGandel)
#### Post date: [November 14, 2023, 9:09am UTC](https://discourse.vtk.org/t/activiz-9-1-display-chinese/8713/16 "2023-11-14T09:09:20Z")

</div>

For information, Activiz 9.3 has been released. It uses UTF-8 encoded strings now, so setting the active codepage to UTF8 is not required anymore 🎉 🥳  
See [https://www.kitware.com/activiz-9-3-release-net-7-and-utf-8-everywhere/](https://www.kitware.com/activiz-9-3-release-net-7-and-utf-8-everywhere/).

@toddy FYI
