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

Subject formatting fix #53

Merged
merged 1 commit into from
May 17, 2022
Merged

Conversation

adriangibanelbtactic
Copy link
Contributor

Now the subject has always the 30 character length size with much less code.

This pull request builds on #52 so it's meant to be approved once the former pull request has been merged into upstream.

@rgladwell rgladwell marked this pull request as draft May 16, 2022 11:51
@adriangibanelbtactic
Copy link
Contributor Author

I brought this fix because some of the subjects were not padded properly.

Also using just a line as hinted by https://stackoverflow.com/a/43939328 was a good thing. No longer was needed to use three extra functions.

Now I see that some of the subjects are still not padded properly, probably because of chinese characters.

I'm currently checking: https://stackoverflow.com/questions/4622357/how-to-control-padding-of-unicode-string-containing-east-asia-characters and https://pythonhosted.org/kitchen/api-text-display.html to see if it's a better approach.

@adriangibanelbtactic
Copy link
Contributor Author

I brought this fix because some of the subjects were not padded properly.

Also using just a line as hinted by https://stackoverflow.com/a/43939328 was a good thing. No longer was needed to use three extra functions.

Now I see that some of the subjects are still not padded properly, probably because of chinese characters.

I'm currently checking: https://stackoverflow.com/questions/4622357/how-to-control-padding-of-unicode-string-containing-east-asia-characters and https://pythonhosted.org/kitchen/api-text-display.html to see if it's a better approach.

It seems that my problem is specifically related to non printable characters.
Those non printable characters messed up with the string length (string length versus the length you get in the screen once you print it).

Removing control characters from the subject line is probably the way to go:

https://stackoverflow.com/a/93029

Also simplify subject formatting code.
@adriangibanelbtactic
Copy link
Contributor Author

Ok, I am now satisfied with the last fix.

You can review this pull request.

Thank you.

@rgladwell rgladwell marked this pull request as ready for review May 17, 2022 18:28
@rgladwell rgladwell merged commit 587e0de into rgladwell:master May 17, 2022
@rgladwell
Copy link
Owner

Thanks.

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