Skip to content

Conversation

Shane32
Copy link
Contributor

@Shane32 Shane32 commented May 2, 2024

Closes #513

@Shane32 Shane32 changed the title Fix character encoding when EciMode is specified [WIP] Fix character encoding when EciMode is specified May 3, 2024
var bytes = Encoding.GetEncoding("ISO-8859-1").GetBytes(input);
var result = Encoding.GetEncoding("ISO-8859-1").GetString(bytes);
return String.Equals(input, result);
return encoding == EncodingMode.Byte ? (codedText.Length / 8) : plainText.Length;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return encoding == EncodingMode.Byte ? (codedText.Length / 8) : plainText.Length;
return encoding == EncodingMode.Byte ? (int)((uint)codedText.Length / 8) : plainText.Length;

do we care about such things here too?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes; we certainly can optimize this PR also.

I need to come back to this PR; but for now I was leaving it alone until I'm finished with performance PRs.

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.

What is the purpose of forceUtf8?
2 participants