Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MC3000 (Invalid character) error in the content of a control containing accented characters for a user control. #10218

Open
Perpete opened this issue Jan 1, 2025 · 4 comments

Comments

@Perpete
Copy link

Perpete commented Jan 1, 2025

Description

In a user control, if a Label control has an accented character in its content (à - â - ä - é - è - ê etc...), we get an error MC3000: XML 'There is an invalid character in the given encoding.

For a normal application project, the problem is not present.

Image

Reproduction Steps

  • Create a user control.
  • Added a label control
  • Added an accented character in the Content property (ex:Labelé).
  • Generate the solution
  • The error is reported

You can test with the attached example

TestUserControl.zip

Expected behavior

No more errors detected like in a normal WPF application.

Actual behavior

Error MC3000: XML 'There is an invalid character in the given encoding.

Regression?

With framework 4.8 there was no problem with my user control.

Known Workarounds

I don't know.

Impact

Unable to use my user control with .net 9.

Configuration

Visual studio 2022 Version 17.12.1
.net 9
Program in VB.

Other information

No response

@miloush
Copy link
Contributor

miloush commented Jan 1, 2025

This is a designer issue, please file feedback using Visual Studio.

It might also help if you change your file encoding to UTF-8.

@Perpete
Copy link
Author

Perpete commented Jan 1, 2025

Thanks for your reply.
I just sent my comments from visual studio.

@himgoyalmicro
Copy link
Contributor

himgoyalmicro commented Jan 3, 2025

@Perpete If we use the encoded value for e, viz é then it works fine as well.

<Label Content="Label&#233;" HorizontalAlignment="Center" Margin="0,60,0,0" VerticalAlignment="Top" Width="110" Background="White" FontSize="24" FontWeight="Bold"/>
<TextBox Text="TextBox&#233;" HorizontalAlignment="Left" Height="40" Margin="125,130,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="115" FontSize="24" FontWeight="Bold"/>
<Button Content="Button&#233;" HorizontalAlignment="Left" Height="40" Margin="125,200,0,0" VerticalAlignment="Top" Width="115" FontSize="24" FontWeight="Bold"/>

@himgoyalmicro himgoyalmicro added the 📭 waiting-author-feedback To request more information from author. label Jan 3, 2025
@Perpete
Copy link
Author

Perpete commented Jan 3, 2025

@himgoyalmicro Thanks for your workaround.

I hope this issue will be fixed in the future.
The problem is only in a user control.

@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback To request more information from author. label Jan 3, 2025
@Perpete Perpete changed the title Error MC3000 (Invalid character) in the content of a Label control for a user control. MC3000 (Invalid character) error in the content of a control containing accented characters for a user control. Jan 4, 2025
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

No branches or pull requests

3 participants