[Solved] converting certain characters from csv file to image problem

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Locked
dav22
Posts: 29
Joined: 2020-02-05T09:22:25-07:00
Authentication code: 1152

[Solved] converting certain characters from csv file to image problem

Post by dav22 »

edit: using ImageMagick-7.0.9-Q16, on windows 7 64 bit
Hi;
I have used some text in csv file to make multiple images, and it works fine except that imagemagick handle some characters from csv file differently.
this an example of text in one row of csv file:
we started to…\n I’ve ever seen.\n it’s tearable.\n They’re here.\n Why couldn’t she? \nit is a girl’s name\n I’ll call you later,

all extra dots (...) and apostrophe will be changed to another characters.
here is the picture of above text after converting to image:
Image

anyway to correct this?
thanks for help.
Last edited by dav22 on 2020-03-01T11:19:30-07:00, edited 1 time in total.

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting certain characters from csv file to image problem

Post by snibgo »

I suspect a codepage problem.

Please paste a link to your CSV file.
snibgo's IM pages: im.snibgo.com

dav22
Posts: 29
Joined: 2020-02-05T09:22:25-07:00
Authentication code: 1152

Re: converting certain characters from csv file to image problem

Post by dav22 »

ya, sorry I did not provide the code:
Edit: here is the link to csv file:
https://www.dropbox.com/s/f841ih6u7eavf ... 1.csv?dl=0
here it is: and I run it in .bat file

Code: Select all

setlocal enabledelayedexpansion
set NUM=0
for /F "tokens=*" %%A in (text-1.csv) do (
   magick ^
    -size 230x300 ^
    -gravity Center ^
    -background Black -fill White ^
    caption:"%%A" ^
    textImage_!NUM!.jpg

  set /A NUM+=1
)

snibgo
Posts: 13034
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: converting certain characters from csv file to image problem

Post by snibgo »

Yes, it's a codepage problem. Add the command "chcp 1251" at the top to fix it.
snibgo's IM pages: im.snibgo.com

dav22
Posts: 29
Joined: 2020-02-05T09:22:25-07:00
Authentication code: 1152

Re: converting certain characters from csv file to image problem

Post by dav22 »

thanks a lot, now it is working

Locked