[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: RFR: 8311216: DataURI can lose information in some charset environments [v4]
From:       Andy Goryachev <angorya () openjdk ! org>
Date:       2023-10-30 18:55:46
Message-ID: hK7O0z5pBn_A6OorFTKfcrpLgZuribCWPhH3-1HSijM=.fdae5302-828a-4383-882e-c414da11ef3b () github ! com
[Download RAW message or body]

On Mon, 30 Oct 2023 18:45:51 GMT, Michael Strauß <mstrauss@openjdk.org> wrote:

> > modules/javafx.graphics/src/main/java/com/sun/javafx/util/DataURI.java line 221:
> > 
> > > 219: 
> > > 220:         ExpectedCharacter expectedCharacter = ExpectedCharacter.DEFAULT;
> > > 221:         byte[] output = new byte[computePayloadSize(input)];
> > 
> > just a thought: what if the url contains no %?  in this case one can simply \
> > return the input string. I think we could return -1 from computePayloadSize() to \
> > indicate that condition.
> 
> The return value is not a string, it's a byte array. So we need to do the \
> conversion anyway, which is what this method is doing quite efficiently by now. \
> It's probably not useful to use another conversion method instead, at least not in \
> terms of performance.

oh yeah.  thanks!

-------------

PR Review Comment: https://git.openjdk.org/jfx/pull/1165#discussion_r1376677138


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic