Skip to content

Fix example build errors in certain code pages#1890

Merged
VisualMelon merged 1 commit into
oxyplot:developfrom
myd7349:fix-example-build-errors
Aug 14, 2022
Merged

Fix example build errors in certain code pages#1890
VisualMelon merged 1 commit into
oxyplot:developfrom
myd7349:fix-example-build-errors

Conversation

@myd7349

@myd7349 myd7349 commented May 21, 2022

Copy link
Copy Markdown
Contributor

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
    屏幕截图 2022-05-21 182136
    屏幕截图 2022-05-21 182234

which will cause build errors in certain code pages.
屏幕截图 2022-05-21 181221

无标题

屏幕截图 2022-05-21 181427

屏幕截图 2022-05-21 181459

屏幕截图 2022-05-21 181633

In iso-8859-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.

屏幕截图 2022-05-21 182819

Checklist

  • I have included examples or tests
  • I have updated the change log
  • I am listed in the CONTRIBUTORS file
  • I have cleaned up the commit history (use rebase and squash)

Changes proposed in this pull request:

  • Change encoding of these three files from ANSI to UTF-8 with BOM.

@oxyplot/admins

@myd7349 myd7349 marked this pull request as ready for review May 21, 2022 11:25
@myd7349 myd7349 force-pushed the fix-example-build-errors branch from 818d105 to ae5dd74 Compare May 29, 2022 00:41
@VisualMelon

Copy link
Copy Markdown
Contributor

Not sure I understand the issue, but doesn't seem to break anything, so I'm happy for this to be merged.

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.
@myd7349 myd7349 force-pushed the fix-example-build-errors branch from ae5dd74 to 2fc2919 Compare August 14, 2022 07:22
@VisualMelon VisualMelon merged commit a7770d3 into oxyplot:develop Aug 14, 2022
@myd7349 myd7349 deleted the fix-example-build-errors branch August 14, 2022 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants