Hi,
I wanted to disable LEAVE_SRC option with all other options in deafult. But FB_DEFAULT ==0 so it works as FB_DEFAULT&LEAVE_SRC.
so there is no way to disable LEAVE_SRC using constants from Encode and not enabling some other option
I ended up using some bit that I think is not used in lib (0x10000)
```
use strict ;
use warnings ;
use utf8 ;
use Encode;
binmode (STDOUT, ':utf8' );
my $s = " \xd1\x83\xd0\xb2\xd0\xb0\xd0\xb6\xd0\xb5\xd0\xbd\xd0\xb8\xd0\xb5\xd0\xbc " ;
Encode::_utf8_off( $s );
my $res = Encode::decode( 'UTF-8' , $s , 0x10000 );
print ( $res . " \n " ); # decoded
print ( $s ); # empty because !( 0x10000& LEAVE_SRC)
```
PS: I understood that « the input scalar STRING might be modified in-place depending on what is set in CHECK. » does not mean that result will be formed in input string, so i dont know it i still need it, but maybe it will save some space. Is there no way to decode/encode in-place?
I considered utf8::decode but it fails on malformed characters
Show quoted text>Пятница, 15 мая 2020, 15:44 +03:00 от Graham Knop via RT <bug-encode@rt.cpan.org>:
>
><URL:
https://rt.cpan.org/Ticket/Display.html?id=132622 >
>
>On Fri May 15 05:35:18 2020, kirare7@mail.ru wrote:
>>
>> Hi, i see no good way to use LEAVE_SRC
>> It only works if « the C<Encode::LEAVE_SRC> bit is I<not> set but
>> I<CHECK> is set », so to encode/decode in-place you need to set some
>> other bit in check.
>> I can set some unused bit but I do not that i have to
>> Cloud you add some new bit IN_PLACE for example or change default
>> and allow LEAVE_SRC with CHECK == 0 ?
>>
>> perl-Encode VERSION: 3.01
>> perl version v5.18.4
>>
>>
>Can you show an example of what you are trying to do that isn't working? Or an example of what you are trying to implement that you can't?