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

Should logger replace NBSP with normal space? #22

Open
allisonkong opened this issue Dec 11, 2022 · 4 comments · May be fixed by #26
Open

Should logger replace NBSP with normal space? #22

allisonkong opened this issue Dec 11, 2022 · 4 comments · May be fixed by #26

Comments

@allisonkong
Copy link
Contributor

Here's what's happening:

  1. In the chatbox, if a character name has a space in it, the game prints it using using U+00A0 (non breaking space) rather than the usual U+0020 space.
  2. Chat logger logs this verbatim, which is a reasonable behavior (as it's exactly what the game printed). However, this makes it quite annoying to search chat logs in grep/vim/etc because U+00A0 doesn't match U+0020.

As an example, I isolated a line from one of my logs:

$ cat example.txt
10:55:00 To Small�Luna: Test
$ hexdump example.txt
0000000 3031 353a 3a35 3030 5420 206f 6d53 6c61
0000010 a06c 754c 616e 203a 6554 7473 0a0d
000001e

Which translates to this:
image
(ignore the endian-ness - the main thing to note is the use of 0xA0 inside "Small Luna")

What do you think about simply replacing all U+00A0 with U+0020 in the log output?

@allisonkong
Copy link
Contributor Author

I'm happy to work on this if you think it's a good idea fwiw.

@hex-agon
Copy link
Owner

hex-agon commented Dec 13, 2022

Hmm, ChatEntry already handles this somewhat (although it seems to be missing from sender), seems like it is an oversight and should be handled before entries get logged. You can use the Text class to standardize the player names.

@fatfingers23
Copy link
Contributor

I'm going to look at solving this tonight. Pretty sure this was my fault with #12 . Whoops.

@fatfingers23 fatfingers23 linked a pull request Dec 28, 2022 that will close this issue
@OsrsMerchant
Copy link

OsrsMerchant commented Oct 14, 2023

I don't think this was ever fixed? It's still adding some odd squares instead of spaces for me

j5ryMuQ

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 a pull request may close this issue.

4 participants