next-image: fix dpl handling with unicode (#90420)
With skew protection enabled, image srcs were double-encoded:
1. The imported value might be `'/_next/static/media/äöüščří.55df2443.png?dpl=1234'`
2. Then `new URL(src, 'http://n')` would normalize the URL, leading to `/_next/static/media/%C3%A4%C3%B6%C3%BC%C5%A1%C4%8D%C5%99%C3%AD.55df2443.png?dpl=1234`
3. The the existing `?url=${encodeURIComponent(src)}` causes the already percent-encoded unicode characters to be encoded yet again.
It's unfortunate that we have to handroll some URL parsing here, maybe someone has a better idea
```
● Image Component Unicode Image URL › production mode › should load static unicode image
expect(received).toMatch(expected)
Expected pattern: /_next%2Fstatic%2Fmedia%2F%C3%A4%C3%B6%C3%BC%C5%A1%C4%8D%C5%99%C3%AD(.+)png/
Received string: "/_next/image?url=%2F_next%2Fstatic%2Fmedia%2F%25C3%25A4%25C3%25B6%25C3%25BC%25C5%25A1%25C4%258D%25C5%2599%25C3%25AD.55df2443.png&w=828&q=75&dpl=test-immutable-tkn-7890"
21 | it('should load static unicode image', async () => {
22 | const src = await browser.elementById('static').getAttribute('src')
> 23 | expect(src).toMatch(
| ^
24 | /_next%2Fstatic%2Fmedia%2F%C3%A4%C3%B6%C3%BC%C5%A1%C4%8D%C5%99%C3%AD(.+)png/
25 | )
26 | const fullSrc = new URL(src, `http://localhost:${appPort}`)
at Object.toMatch (integration/next-image-legacy/unicode/test/index.test.ts:23:17)
● Image Component Unicode Image URL › production mode › should load static unicode image
expect(received).toMatch(expected)
Expected pattern: /_next%2Fstatic%2Fmedia%2F%C3%A4%C3%B6%C3%BC%C5%A1%C4%8D%C5%99%C3%AD(.+)png/
Received string: "/_next/image?url=%2F_next%2Fstatic%2Fmedia%2F%25C3%25A4%25C3%25B6%25C3%25BC%25C5%25A1%25C4%258D%25C5%2599%25C3%25AD.55df2443.png&w=828&q=75&dpl=test-immutable-tkn-7890"
22 | it('should load static unicode image', async () => {
23 | const src = await browser.elementById('static').getAttribute('src')
> 24 | expect(src).toMatch(
| ^
25 | /_next%2Fstatic%2Fmedia%2F%C3%A4%C3%B6%C3%BC%C5%A1%C4%8D%C5%99%C3%AD(.+)png/
26 | )
27 | const fullSrc = new URL(src, `http://localhost:${appPort}`)
at Object.toMatch (integration/next-image-new/unicode/test/index.test.ts:24:17)
```