-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First char is omitted in result #51
Comments
Provide a reproduce-able test case. I.e., |
Yields the following output:
As you can see, |
Unfortunately, I still can't reproduce this with your given information with my example demo. Can you provide a self-contained repository so that I can just clone and run for reproduction? I cannot reproduce it with your codes as well. |
It's not missing it is replaced with space wich comes from here, if you change it to any other char it will prepend it. It does not reproduces at least on php 8.0, but reproduces on php 7.2. It is not package issue, it seems like there is no header passed on php7.x so php-mb-string trims first character and prepend space to string. |
It seems like alpine iconv issue, can reproduce on all php:x.x-fpm-alpine docker images, works fine on debian based images. |
It looks like many people have reported that alpine's iconv has some issues... with various solutions I didn't try. Could you test whether this branch workarounds the issue? |
php:7.4-fpm-alpine now it append A 2 times:
Output:
|
@bAngerman I pulled |
I have updated my version to your provided version, but issues still remain.
|
@bAngerman Are you using a PHP docker image or something that I can use for reproducing the issue? |
is the Dockerfile I am using for PHP |
@bAngerman Unfortunately, I can't reproduce this with your Dockerfile and proposed codes. <?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use Jfcherng\Diff\DiffHelper;
function getContentDiff($old, $new)
{
$renderer_name = 'Combined';
$differ_options = [];
$renderer_options = [
'detailLevel' => 'word',
];
$diff = DiffHelper::calculate($old, $new, $renderer_name, $differ_options, $renderer_options);
return $diff;
}
echo "\n\n";
echo getContentDiff(
'This is a brand new note! New text.',
'Modified the content.',
);
echo "\n\n"; Outputs:
@fomk Can you still reproduce this after |
My mistake @jfcherng , I improperly installed the version. It is now working that I have resolved my composer issues. Thank you! |
I am using version 6.11.1
I am encountering an issue where only the first character is missing when a diff is calculated.
Here is my function containing use of the php-diff tool.
As you can see from the following image, after an edit is made the diff omits the first character of the line in the diff.
Any advice?
The text was updated successfully, but these errors were encountered: