ASP.NET Chart Controls and Character Encoding Issues

I am trying to use ASP.NET chart controls for a website that is localized in multiple languages. However, we had problems with charts when we recently added Chinese localization - all the labels show the squares on which we actually want to use Chinese characters, as shown in my example below (note, I don’t know Chinese, so this may say anything)

default.aspx (without code):

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="ChineseChart._Default" %> <%@ Register Assembly="System.Web.DataVisualization, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI.DataVisualization.Charting" TagPrefix="asp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Chart runat="server" Height="270px" Palette="None" PaletteCustomColors="0, 192, 96; 0, 96, 48"> <legends> <asp:Legend Alignment="Center" Docking="Bottom" Name="Legend1" BorderColor="Black"> </asp:Legend> </legends> <titles> <asp:Title Name="Title1" Text="ζˆ‘ηš„η€ΊδΎ‹ε›Ύθ‘¨"> </asp:Title> </titles> <series><asp:Series Name="富" ChartType="Pie" Legend="Legend1"> <points> <asp:DataPoint AxisLabel="酒吧" MapAreaAttributes="" ToolTip="" Url="" YValues="65" /> <asp:DataPoint AxisLabel="富" MapAreaAttributes="" ToolTip="" Url="" YValues="24" /> </points> </asp:Series> </series> <chartareas><asp:ChartArea Name="ChartArea1"></asp:ChartArea></chartareas> </asp:Chart> </div> </form> </body> </html> 

Generated Chart:

ζˆ‘ ηš„ η€ΊδΎ‹ 图葨
(source: simonrice.com )

For me, this indicates a character encoding problem, but I cannot find anything in the chart object to change the encoding of the control.

Is there any way I can solve this problem?

Update: we also have this site in Greek and Hebrew, and none of these languages ​​causes us any problems on the charts.

+4
source share
1 answer

If the language packs of the non-Latin alphabet, in particular, Asian languages, are not installed on the computer, Arial Unicode MS is the only readily available font that will display these characters.

The real drawback of this font is that it looks like crap when displaying languages ​​such as English that use the Latin alphabet.

+2
source

Source: https://habr.com/ru/post/1302857/


All Articles