View Issue Details

Category
SSPBT:本体(SSP)
SeverityminorReproducibilityalways 
Status closed 
Summary0000159: URL escape characters no longer work with \j command
Description

Thank you for fixing the multi-byte characters in the \j command, it's been very useful. There's a small problem that was introduced when it was fixed, though. Escape characters such as %0A (a line break) no longer work, and are escaped again, becoming something like %250A (%25 is a %)

Activities

ponapalt

2021-05-20 04:58

administrator   ~0000341

SSP can't distinguish "partially encoded" URL, because "%" is commonly used character.
In such case, please provide fully encoded URL, or avoid using CR/LF.

guest

2021-05-20 06:22

reporter   ~0000342

Hmm, what do you mean by fully encoded URL? I can make this work without linebreaks, but it would be much nicer with them, so if it's possible to do it then I will try.

ponapalt

2021-05-22 04:24

administrator   ~0000352

Please provide sample problematic URL. I'll check it.

"fully encoded" means percent-encoded valid URL string.
https://en.wikipedia.org/wiki/Percent-encoding

guest

2021-05-22 18:05

reporter   ~0000354

This might be tricky, the issue is that the URL isn't going to be a static thing. The ghost I'm working on listens to other ghosts, extracts most of the sakurascript tags from their dialogue, and then opens a translator website with the dialogue pasted in. Linebreaks make it a lot easier to read, but they no longer work. Still, I'll take that over multi-byte characters not working at all.
Here's an example (The function is still a work in progress)
\j[https://www.deepl.com/translator#en/jp/%0A%0AExtra Char: %0A%0AMain Character: %0A%0ASide Character: Main Character: Squidさん、おつかれさま~。]

ponapalt

2021-06-03 04:20

administrator   ~0000366

If you can use YAYA,
STRENCODE(_string,1,'url')
can help you to make fully-encoded string.

Note : do not use %0A when using STRENCODE. Instead, please use CHR(10) to add LF, or CHR(13,10) to add CRLF.

guest

2021-06-04 10:00

reporter   ~0000367

That works, thank you!
I ran into another issue, this one is really strange. It may not be an issue with SSP at all, but I should probably let you know anyways just in case.

So if I run this command, all the encoded characters are escaped again, and the dialogue that goes into the translator ends up a mess:

\j[https://www.deepl.com/translator#en/jp/%0D%0A%0D%0AExtra+Char%3A++%0D%0A%0D%0AMain+Character%3A++Main+Character%3A++%0D%0A%0D%0ASide+Character%3A++%E3%81%82%E3%80%81%E3%82%B4%E3%82%AD%E3%83%96%E3%83%AA%E7%99%BA%E8%A6%8B%E3%80%82%0D%0A%0D%0AMain+Character%3A++%E3%81%84%E3%82%84%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E3%83%83%EF%BC%81%EF%BC%81%0D%0A%0D%0ASide+Character%3A++%E2%80%A6%E2%80%A6%E5%B0%91%E3%81%97%E3%81%AF%E3%83%8D%E3%82%B3%E3%82%89%E3%81%97%E3%81%8F%E3%81%97%E3%81%9F%E3%82%89%E3%81%A9%E3%81%86%E3%81%AA%E3%81%AE%EF%BC%9F]

But if I copy and paste that url directly into my browser, the url itself works without issue. I'll attach images, one from the \j command and one that was directly copied into the browser.

However, I've only had that issue with that particular website (DeepL). If I run it through google translate instead with this command:

\j[https://translate.google.com/?sl=jp&tl=en&text=%0D%0A%0D%0AExtra+Char%3A++%0D%0A%0D%0AMain+Character%3A++Main+Character%3A++%0D%0A%0D%0ASide+Character%3A++%E3%81%82%E3%80%81%E3%82%B4%E3%82%AD%E3%83%96%E3%83%AA%E7%99%BA%E8%A6%8B%E3%80%82%0D%0A%0D%0AMain+Character%3A++%E3%81%84%E3%82%84%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E2%80%95%E3%83%83%EF%BC%81%EF%BC%81%0D%0A%0D%0ASide+Character%3A++%E2%80%A6%E2%80%A6%E5%B0%91%E3%81%97%E3%81%AF%E3%83%8D%E3%82%B3%E3%82%89%E3%81%97%E3%81%8F%E3%81%97%E3%81%9F%E3%82%89%E3%81%A9%E3%81%86%E3%81%AA%E3%81%AE%EF%BC%9F]

That command works fine. Like I said, it might not be an SSP issue at all, I'm not sure. It's very strange though.
Thanks so much for your help with this, I think I can get the ghost working even if DeepL doesn't work

21-6-3_01.png (118,452 bytes)   
21-6-3_01.png (118,452 bytes)   
21-6-3_02.png (36,168 bytes)   
21-6-3_02.png (36,168 bytes)   

ponapalt

2021-06-06 14:03

administrator   ~0000372

2.5.03 FIXED

DeepL text problem is also fixed, because it's SSP encoding detection problem.

Issue History

Date Modified Username Field Change
2021-05-20 04:52 guest New Issue
2021-05-20 04:58 ponapalt Note Added: 0000341
2021-05-20 06:22 guest Note Added: 0000342
2021-05-22 04:17 ponapalt Assigned To => ponapalt
2021-05-22 04:17 ponapalt Status new => assigned
2021-05-22 04:24 ponapalt Note Added: 0000352
2021-05-22 18:05 guest Note Added: 0000354
2021-06-03 04:20 ponapalt Note Added: 0000366
2021-06-04 10:00 guest Note Added: 0000367
2021-06-04 10:00 guest File Added: 21-6-3_01.png
2021-06-04 10:00 guest File Added: 21-6-3_02.png
2021-06-06 14:03 ponapalt Status assigned => closed
2021-06-06 14:03 ponapalt Resolution open => fixed
2021-06-06 14:03 ponapalt Note Added: 0000372