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

Unicode is not displayed correctly in some places #414

Closed
pastalian opened this issue Feb 27, 2021 · 3 comments
Closed

Unicode is not displayed correctly in some places #414

pastalian opened this issue Feb 27, 2021 · 3 comments

Comments

@pastalian
Copy link
Contributor

pastalian commented Feb 27, 2021

LRR Version and OS
dev-4172e92, debian container

Bug Details
There are some places where unicode is not displayed correctly.

  • Logs
  • Filename Parsing
    • When generating tags containing multibyte characters with this plugin in Edit Mode (only first time, save & reload will fix it)
    • Some characters like ★ (U+2605) and 々 (U+3005) will completely break the tag (reload will not fix it)

Matching Logs

[Minion] [info] Processing uploaded file /tmp/6LUeaFARLj/[�������] �������.tar...
[Archive] [debug] File Name: [�������] �������
[Archive] [debug] Filesystem Path: /LANraragi/content/[�������] �������.tar
[regexparse] [info] Sending the following tags to LRR: artist:�������
[regexparse] [info] Parsed title is �������

Screenshots
bugged

@pastalian
Copy link
Contributor Author

I guess using redis_decode() will fix above 2 bugs?
Apparently file paths are intentionally not encoded, but I think the log output should be encoded (there's no point in an unreadable log).

Difegue added a commit that referenced this issue Feb 28, 2021
@Difegue
Copy link
Owner

Difegue commented Feb 28, 2021

Yup, moving regexparse around from internal code to the plugin system adds an extra layer since we're accessing the file name from $lrr_info now. Forgot about that and added a decode there, should work fine in all cases.

The logs being garbled depend on where the newly uploaded file is coming from.
Files coming from Shinobu/file watching will show correctly, but files coming from Minion/web uploads won't. (Probably because of the necessary utf8::downgrade workaround)

redis_decode is basically the magic function for everything unicode now, but I don't like overusing it either since logging fully-decoded text can spew out wide character in say warnings from Perl, and it does overall muddy up the logic since what you're displaying isn't exactly what's being used in code...

I've added decodes to the Minion side of logging for now, so even if it garbles up a bit further down the chain users can still figure it out. Not sure why it does garble at all, since everything else seems to be working fine. 🤔

@Difegue Difegue closed this as completed Feb 28, 2021
@pastalian
Copy link
Contributor Author

pastalian commented Feb 28, 2021

Thanks, but there is one part that is forgotten 😢

$logger->debug("File Name: $name");
$logger->debug("Filesystem Path: $file");

EDIT: Oh, I understand what you're saying now.

Difegue added a commit that referenced this issue Mar 11, 2021
* [ImgBot] Optimize images

*Total -- 955.60kb -> 756.84kb (20.8%)

/tools/Documentation/.gitbook/assets/ratings.png -- 131.97kb -> 86.23kb (34.66%)
/tools/Documentation/.gitbook/assets/index.png -- 193.08kb -> 129.82kb (32.76%)
/tools/Documentation/.gitbook/assets/archive_thumb.jpg -- 630.55kb -> 540.78kb (14.24%)

Signed-off-by: ImgBotApp <[email protected]>

* Do not show page select when there are no results

* Also hide table header

* Update buildx action to the official Docker one

* Update s6

* Update less, the alpine package doesn't seem to have s6-overlay-preinit yet?

* pin s6 alpine package

* Rollback alpine base for now

* Fix ARM builds (#394)

* Update push-continous-delivery.yml

* Update release-delivery.yml

* Update push-continous-delivery.yml

* Update push-continous-delivery.yml

* Improve visibility when sorting table columns + fix being able to put whitespace as a custom column

* Fix context menu applying to overlays

* (#374) Remove cooldown on auto-plugin as it's basically useless

* Fix memory leak caused by the Parallel::Loops/Storable combo in the Search API

* Add some basic retrying logic on our first Redis connection
This avoids dying unnecessarily if Redis takes a while to load into memory.

* Accept "false" properly for pinned on category creation

* Also fix the update_cat endpoint

* Remove favtagmigration script

* Add a simple GET to /api/categories/:id

* (#335) Reading progression is now server-side!

* Fix method for progress in docs

* Fix docs thanks for nothing gitbook

* (#385) (#397) Remove the built-in Auto-Tag feature in favor of a Filename parsing plugin

* Fix tests

* Avoid uninitialized warnings if there's no progress/pagecount in DB

* Add a pageread stat and actually use the package.json description 'cause why not

* Remove unnecessary datatables cdn include

* (#282) Rewrite Shinobu filemap so it relies on Redis and keeps state between restarts

* (#405) Add job + api req to regen all thumbnails
Also remove redis loading timeout for REALLY BIG dataset

* (#410) NFC all the things

* Add fa-solid-900.woff2 to the vendor deps
so that browsers finally shut up about it, also added fa-regular

* Fix submenu arrow colors in the various themes

* autism

* Add an API endpoint to return which categories an ID belongs to

* (#375) Rework context menu so it uses the new endpoint to remove archives from categories

* More doc details on the reading progression API

* Some more documentation fixes

* MORE Documentation updates gee

* (#412) Add autofocus to the password input in login

* (#397) Add a check to RegexParse to avoid putting numbers as languages

* (#414) Fix regexparse not decoding the filesystem path + decode log in minion upload for extra clarity

* (#389) Update magick to v7 in homebrew

* backport changes from homebrew-core
those guys write ruby way better than I do

* Fix brew test runs

* (#389) Add libheif to Dockerfile and unlock avif/heif support

* Don't recommend homebrew for linux since it doesn't work out of the box atm

* Add Mojolicious::Plugin::Status when running in debug mode

* Update docs to fix wrong json examples

* Stop using a static secret for mojo's cookie signatures

* Remove the auto-plugin toggle and matching pref
It's a bit unnecessary considering plugins have to be toggled manually anyways.

* Rework Plugin Configuration page a bit further

* (#267) Make the thumbnail folder location an option

* [ImgBot] Optimize images (#416)

/tools/Documentation/.gitbook/assets/thumbchange.png -- 55.64kb -> 36.35kb (34.67%)

Signed-off-by: ImgBotApp <[email protected]>

Co-authored-by: ImgBotApp <[email protected]>

* Add some JS to migrate local reading progression

Co-authored-by: ImgBotApp <[email protected]>
Co-authored-by: Cirno the Strongest <[email protected]>
Co-authored-by: imgbot[bot] <31301654+imgbot[bot]@users.noreply.github.com>
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

2 participants