magento2 – Import products do not escape the slash before in the category

I'm trying to import products into v2.2.7 but apparently this has been a problem since 2016 and has not been solved before v2.3.x.

When importing into magento, some categories look like Socks / types a / b. When I import without changing anything, the structure is as follows:

socks
`- tape a
`- b

If I use ascii, I end up visually with the right text in the backend, but all my URL strings are in ascii and the own URL in the background is not correct with the help of & # 47; and the products that should be nested there are not nested properly.

socks
`- types a / b

If I download a category that looks like this Socks / types a / b, I end up with the following:

socks
`- tape a 
`- b

The ascii and escape option are discussed in a problem here. Escape could be the ideal solution to import because I could easily handle hundreds of records.

The suggested solution in this thread is:

// In  Magento  CatalogImportExport  Model  Import  Product  Category, there is an upsertCategory function.

protected function upsertCategory ($ categoryPath)
{
if (! isset ($ this-> categories[$categoryPath])) {
$ pathParts = explode (self :: DELIMITER_CATEGORY, $ categoryPath);
$ parentId =  Magento  Catalog  Template  Category :: TREE_ROOT_ID;
$ path = & # 39;

foreach ($ pathParts as $ pathPart) {
$ path. = $ pathPart;
if (! isset ($ this-> categories[$path])) {
$ this-> categories[$path] = $ this-> createCategory ($ pathPart, $ parentId);
}
$ parentId = $ this-> categories[$path];
$ path. = self :: DELIMITER_CATEGORY;
}
}

returns $ this-> categories[$categoryPath];
}

However, I'm new to Magento and I do not see Magento CatalogImportExport in the directory structure. I looked in seller and do not see CatalogImportExport there either.

I have a script that can replace all / with /. However, magento does not escape the /. The desired directory structure when importing
Socks / types a / b is:

socks
`- types a / b

Does anyone know how I can do this work in V2.2.x or especially v2.2.7?