Reputation: 183
my problem in this question is with Persian characters :
in my app , in browser , my messages and texts are display very well but in back of the Scene is not good , look at image:
and back (in browser page source):
there are this characters , and main problem is here :
in view.cshtml:
@foreach (var choice in question.QuestionChoices)
{
<div class="databox radius-bordered bg-lightgray">
<div class="databox-right bg-blueberry">
<div class="databox-piechart">
<div data-toggle="easypiechart" class="easyPieChart" data-barcolor="#fff" data-linecap="butt" data-percent="50" data-animate="500" data-linewidth="3" data-size="47" data-trackcolor="rgba(255,255,255,0.1)" style="width: 47px; height: 47px; line-height: 47px;">
<span class="white font-90">@choice.AnswerChoices.Count</span>
</div>
</div>
</div>
<div class="databox-left">
<span class="databox-number blueberry"><a style="color: inherit">@choice.Text </a></span>
<div class="databox-text darkgray"></div>
</div>
</div>
}
in top code look at : @choice.Text and result:
<div class="databox radius-bordered bg-lightgray">
<div class="databox-right bg-blueberry">
<div class="databox-piechart">
<div data-toggle="easypiechart" class="easyPieChart" data-barcolor="#fff" data-linecap="butt" data-percent="50" data-animate="500" data-linewidth="3" data-size="47" data-trackcolor="rgba(255,255,255,0.1)" style="width: 47px; height: 47px; line-height: 47px;">
<span class="white font-90">0</span>
</div>
</div>
</div>
<div class="databox-left">
<span class="databox-number blueberry"><a style="color: inherit">گزینه 1 </a></span>
<div class="databox-text darkgray"></div>
</div>
</div>
<div class="databox radius-bordered bg-lightgray">
<div class="databox-right bg-blueberry">
<div class="databox-piechart">
<div data-toggle="easypiechart" class="easyPieChart" data-barcolor="#fff" data-linecap="butt" data-percent="50" data-animate="500" data-linewidth="3" data-size="47" data-trackcolor="rgba(255,255,255,0.1)" style="width: 47px; height: 47px; line-height: 47px;">
<span class="white font-90">1</span>
</div>
</div>
</div>
<div class="databox-left">
<span class="databox-number blueberry"><a style="color: inherit">گزینه2 </a></span>
<div class="databox-text darkgray"></div>
</div>
</div>
now in top html rendered a (گزینه 2) as a code how i can fix this issue?
my code is in C# and Asp.net Core. tnx.
Upvotes: 1
Views: 1043
Reputation: 183
services.AddSingleton<HtmlEncoder>(
HtmlEncoder.Create(allowedRanges: new[] { UnicodeRanges.BasicLatin,
UnicodeRanges.Arabic }));
Upvotes: 1
Reputation: 2514
It looks like you are using a component called "easypiechart" which is not displaying the characters correctly. Is that right?
You must talk to the easypiechart programmers and find a way to fix the problem.
The problem does not seem to be with asp.net core.
Upvotes: 0