Hello,
I'm parsing a URL and I get – instead of - but the text shows up correctly.
The skin is currently encoded in UCS-2 LE BOM. I tried UTF-8 but it didn't do much...
Any ideas? (Also there's Greek text being parsed, which means special characters, if that matters. Text shows up correctly though)
-Thanks in advance.
It is currently April 18th, 2024, 9:13 am
WebParser returns HTML value.
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: WebParser returns HTML value.
This is not about encoding in the skin.kyriakos876 wrote: ↑October 17th, 2018, 12:41 pm Hello,
I'm parsing a URL and I get – instead of - but the text shows up correctly.
The skin is currently encoded in UCS-2 LE BOM. I tried UTF-8 but it didn't do much...
Any ideas? (Also there's Greek text being parsed, which means special characters, if that matters. Text shows up correctly though)
-Thanks in advance.
That HTML Character Reference is malformed. It should be –, and then you use https://docs.rainmeter.net/manual/measures/webparser/#DecodeCharacterReference on the child measure returning it. Sure you aren't missing the ; on the code when you are parsing it?
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: WebParser returns HTML value.
Yea sorry, I forgot the ;.jsmorley wrote: ↑October 17th, 2018, 12:59 pm This is not about encoding in the skin.
That HTML Character Reference is malformed. It should be –, and then you use https://docs.rainmeter.net/manual/measures/webparser/#DecodeCharacterReference on the child measure returning it. Sure you aren't missing the ; on the code when you are parsing it?
I tried DecodeCharacterReference=2 in my child measure and it worked. One question I have though is:
Do I need to decode both, numeric character references and character entity references?
Why do DecodeCharacterReference=2 and DecodeCharacterReference=3 exist? Couldn't it be DecodeCharacterReference=1? Is it doing more work to have it =1 so we prefer to specify the decoding or something?
-
- Developer
- Posts: 22629
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: WebParser returns HTML value.
I just always use DecodeCharacterReference=1, no more work is involved. The others are there just for maximum flexibility.kyriakos876 wrote: ↑October 17th, 2018, 1:10 pm Yea sorry, I forgot the ;.
I tried DecodeCharacterReference=2 in my child measure and it worked. One question I have though is:
Do I need to decode both, numeric character references and character entity references?
Why do DecodeCharacterReference=2 and DecodeCharacterReference=3 exist? Couldn't it be DecodeCharacterReference=1? Is it doing more work to have it =1 so we prefer to specify the decoding or something?
-
- Posts: 919
- Joined: January 30th, 2017, 2:01 am
- Location: Greece
Re: WebParser returns HTML value.
Roger that