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

Fixed encoding provider loading on .NET Framework (for .NET Standard 2.0 target) #1036

Conversation

NightOwl888
Copy link
Contributor

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a change, please open an issue to discuss the change or find an existing issue.

Summary of the changes (Less than 80 chars)

Fixed encoding provider loading on .NET Framework (for .NET Standard 2.0 target)

Fixes #1025

Description

Added EncodingProviderInitializer class to Lucene.Net.Analysis.Kuromoji and Lucene.Net.Analysis.SmartCn to prevent loading problems on the netstandard2.0 target when the runtime is .NET Framework.

…odingProviderInitializer classes to ensure we don't load the encoding provider on a .NET Framework runtime when targeting netstandard2.0 (fixes apache#1025)
@NightOwl888 NightOwl888 added the notes:bug-fix Contains a fix for a bug label Nov 19, 2024
Copy link
Contributor

@paulirwin paulirwin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, unless we wanted to share EncodingProviderInitializer between the projects in Lucene.Net core.

@NightOwl888
Copy link
Contributor Author

Looks good, unless we wanted to share EncodingProviderInitializer between the projects in Lucene.Net core.

Yeah, I thought of that, but it requires a dependency on System.Text.Encoding.CodePages. So, the best we can do to share this is to make it a linked file that does not a belong to any project.

There is quite a bit of duplicated code in these analysis projects (for example CSVUtil in kuromoji and nori), so this seems like the trend.

@NightOwl888 NightOwl888 merged commit 2d4d332 into apache:master Nov 19, 2024
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notes:bug-fix Contains a fix for a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EncodingProvider won't load when target is .NET Standard 2.0 and runtime is .NET Framework
2 participants