• In some cases, when trying to import multibyte characters, the column will shift.
    Specifically, if the last character of the column is multibyte, this phenomenon may occur.
    This has been reported in the following site. Is there any plan to improve this?
    https://migi.me/wordpress/really-simple-csv-importer-point/

    マルチバイト文字をインポートしようとすると、カラムがずれるケースがある。
    具体的にはカラムの最後の文字がマルチバイトだとこのような現象が起きる場合があります。
    下記のサイトでも報告されていますが、こちらは改善の予定はありますか?
    https://migi.me/wordpress/really-simple-csv-importer-point/

Viewing 15 replies - 1 through 15 (of 21 total)
  • Plugin Author Takuro Hishikawa

    (@hissy)

    You should use LibreOffice in all cases, I strongly recommend you to use it, not MS Excel.

    In short, No.

    Thread Starter Anon_

    (@kuroro111)

    I thought I had confirmed that using LibreOffice would not work, but I tried again and it imported fine.
    If a similar event occurs again, I will report it.
    Thank you.

    • This reply was modified 3 years, 7 months ago by Anon_.
    Thread Starter Anon_

    (@kuroro111)

    @hissy
    うーん。やはりLibre Officeを使ってもずれています。
    文字はダブルクォートの引用符で囲っています。
    カスタムフィールドキーが日本語だとずれたりとかしませんか?

    Thread Starter Anon_

    (@kuroro111)

    かならず全角文字というわけではなさそう。
    例えば下記のケースでは、全角の”)”で終わっている”MIX(プードル×ペキニーズ)”というタイトルの行が、”post_date”とくっついてしまい、タイトルは下記のように登録される。
    ダブルクォートもそのまま表示されている。

    MIX(プードル×ポメラニアン)”,”,2020-10-31 18:20:23″

    
    "post_id","post_type","post_status","post_name","post_title","post_content","post_date"
    "","pet","private","","MIX(プードル×ペキニーズ)","","2020-10-31 18:12:32"
    "","pet","private","","ポメラニアン","","2020-10-31 18:45:50"
    "","pet","private","","MIX(プードル×ポメラニアン)","","2020-10-31 18:20:23"
    Plugin Author Takuro Hishikawa

    (@hissy)

    @kuroro111

    Actually, I didn’t write any codes related to parsing CSV files, this plugin relies on PHP’s fgetcsv function. I don’t have any plan to write original code or include any other 3rd party library to replace fgetcsv() function. I believe the format of your CSV file is wrong, but I can’t help to fix it. Do your best.

    Plugin Author Takuro Hishikawa

    (@hissy)

    @kuroro111

    One more piece of advice. You shouldn’t wrap empty cells with quotes. See the document:

    Usually an enclosure character is escaped inside a field by doubling it

    https://www.php.net/manual/en/function.fgetcsv.php

    It should be like this:

    ,"pet","private",,"MIX(プードル×ペキニーズ)",,"2020-10-31 18:12:32"

    Plugin Author Takuro Hishikawa

    (@hissy)

    LibreOffice won’t wrap empty cells with quotes. Did you really use LibreOffice to make your CSV file?

    Thread Starter Anon_

    (@kuroro111)

    I used the libreoffice function to add the quotes.
    I’ll try importing it without quotes now.

    • This reply was modified 3 years, 6 months ago by Anon_.
    Thread Starter Anon_

    (@kuroro111)

    It still didn’t work.

    In the results display after importing, the date is attached to the title.
    The CSV file format is UTF-8, but what else could it be?

    
    "トイプードル”,,2020-04-22 17:59:14"" の処理が完了しました。
    "ポメラニアン”,,2020-07-29 17:39:12"" の処理が完了しました。
    "ポメラニアン”,,2020-09-15 18:51:13"" の処理が完了しました。
    "チワワ”,,2020-10-20 19:26:44"" の処理が完了しました。
    
    Plugin Author Takuro Hishikawa

    (@hissy)

    Anyways, I believe your CSV file is invalid. Check your file first. Check it with some online validator. Try to open it with another software like Excel or Google Spreadsheet. Good luck.

    Thread Starter Anon_

    (@kuroro111)

    https://drive.google.com/file/d/12tmO5NQFg8BGsSKHVGEzWCYCF_LVg6nv/view?usp=sharing

    I checked the display in Google Drive and imported the downloaded file, but the result is the same.
    I uploaded the file to GDrive so you can see it.
    I changed the post_type to post, so you can try importing it if you like.

    Plugin Author Takuro Hishikawa

    (@hissy)

    The file you uploaded to Google Drive seems fine, and succeed to import it correctly, with no error.

    Thread Starter Anon_

    (@kuroro111)

    I don’t know what’s going on anymore.
    I also uploaded it to the “post” section, but the result is the same.
    My environment is as follows.

    WordPress 5.7.2
    PHP 7.1.33
    Really Simple CSV Importer 1.3

    Thread Starter Anon_

    (@kuroro111)

    https://www.softel.co.jp/blogs/tech/archives/2333

    原因が分かったかもしれません。
    そちらのテスト環境のWPの言語設定はEnglish等でimportされてませんか?
    fgetcsvは環境の言語設定に依存する処理があるので、
    setlocaleやmb_convert_encodingなどで処理する必要ありますが、これらの記述がプラグイン内に見当たりません。

    試しにWPの言語設定(WP_Lang)をEnglishにしたら正常に読み込めました。
    マルチバイトで不具合を訴えている方々の不具合はこれが原因ではないでしょうか。

    WPの言語設定に影響を受けずに処理できるよう修正可能でしょうか?
    アップロードファイルをUTF-8に限定しているのであれば、難しい修正にはならないと思います。

    Plugin Author Takuro Hishikawa

    (@hissy)

    Unfortunately, I don’t have any plan to update this plugin now. This plugin is already outdated, so please use it at your own risk. Of course, welcome to send a pull request on the Github repository. Thank you for your report.

Viewing 15 replies - 1 through 15 (of 21 total)
  • The topic ‘In some cases, when trying to import multibyte characters, the column will shift’ is closed to new replies.