Skip to content

Commit a7770d3

Browse files
authored
Fix ExampleLibrary build errors in certain code pages (#1890)
Currently, these three files have an ANSI encoding: - Source/Examples/ExampleLibrary/Annotations/ArrowAnnotationExamples.cs - Source/Examples/ExampleLibrary/Annotations/TextAnnotationExamples.cs - Source/Examples/ExampleLibrary/Examples/RenderingCapabilities.cs which will cause build errors in certain code pages. For example, in iso-8851-1 and cp936, degree symbol is not the same: >>> '°'.encode('iso-8859-1') b'\xb0' >>> '°'.encode('cp936') b'\xa1\xe3' and when it comes to cp936, it can not understand '0xb0' correctly. Solution: Change encoding of these three files from ANSI to UTF-8 with BOM.
1 parent 847d255 commit a7770d3

File tree

5 files changed

+8
-6
lines changed

5 files changed

+8
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ All notable changes to this project will be documented in this file.
2727
- Axes not always honoring AbsoluteMinimum/AbsoluteMaximum and/or MinimumRange/MaximumRange properties (#1812)
2828
- WindowsForms tracker no longer clipping outside PlotView boundaries (#1863)
2929
- Histogram now rendering properly when using logarithmic Y axis (#740)
30+
- Fix ExampleLibrary build errors in certain code pages (#1890)
3031

3132
## [2.1.0] - 2021-10-02
3233

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ moes_leco
102102
moljac
103103
mroth
104104
mrtncls
105+
myd7349 <myd7349@gmail.com>
105106
Oleg Tarasov <oleg.v.tarasov@gmail.com>
106107
Oystein Bjorke <oystein.bjorke@gmail.com>
107108
Patrice Marin <patrice.marin@thomsonreuters.com>

Source/Examples/ExampleLibrary/Annotations/ArrowAnnotationExamples.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// --------------------------------------------------------------------------------------------------------------------
1+
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="ArrowAnnotationExamples.cs" company="OxyPlot">
33
// Copyright (c) 2014 OxyPlot contributors
44
// </copyright>
@@ -85,7 +85,7 @@ public static PlotModel Rotations()
8585
new ArrowAnnotation
8686
{
8787
EndPoint = new DataPoint(i % 45, i / 45),
88-
Text = $"{i}°",
88+
Text = $"{i}°",
8989
ArrowDirection = new ScreenVector(Math.Cos(rad), Math.Sin(rad)) * 25,
9090
HeadLength = 5
9191
});

Source/Examples/ExampleLibrary/Annotations/TextAnnotationExamples.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// --------------------------------------------------------------------------------------------------------------------
1+
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="TextAnnotationExamples.cs" company="OxyPlot">
33
// Copyright (c) 2014 OxyPlot contributors
44
// </copyright>
@@ -74,7 +74,7 @@ public static PlotModel Rotations()
7474
{
7575
TextRotation = i,
7676
TextPosition = new DataPoint(i % 45, i / 45),
77-
Text = $"{i}°",
77+
Text = $"{i}°",
7878
TextVerticalAlignment = VerticalAlignment.Middle,
7979
TextHorizontalAlignment = HorizontalAlignment.Center
8080
});

Source/Examples/ExampleLibrary/Examples/RenderingCapabilities.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// --------------------------------------------------------------------------------------------------------------------
1+
// --------------------------------------------------------------------------------------------------------------------
22
// <copyright file="RenderingCapabilities.cs" company="OxyPlot">
33
// Copyright (c) 2014 OxyPlot contributors
44
// </copyright>
@@ -805,7 +805,7 @@ public static PlotModel LineJoins()
805805
var dy = Math.Cos(halfAngle) * LINE_LENGTH;
806806

807807
var textP = new ScreenPoint(15, y);
808-
rc.DrawText(textP, angle.ToString() + "°", OxyColors.Black, fontSize: 12);
808+
rc.DrawText(textP, angle.ToString() + "°", OxyColors.Black, fontSize: 12);
809809

810810
foreach (LineJoin lineJoin in Enum.GetValues(typeof(LineJoin)))
811811
{

0 commit comments

Comments
 (0)