You are not logged in.

Announcement

 Téléchargez la dernière version stable de GLPI      -     Et vous, que pouvez vous faire pour le projet GLPI ? :  Contribuer
 Download last stable version of GLPI                      -     What can you do for GLPI ? :  Contribute

#1 2009-03-26 10:17:19

masonmark
Member
Registered: 2009-03-18
Posts: 12

data_injection cannot import data where fields begin with Japanese tex

Hello,

I tried to import CSV data using data_injection plugin.

It works with English text, but when the field begins with Japanese text, it fails.

If I change the data such that each field begin first with "." and then the Japanese text following, it works.

E.g., if my data in .csv file is:

日本語、日本語、abc, 123
.日本語, .にほんご, def, 456

The first row cannot import, because the first 2 fields show as blank (you can tell in the plugin wizard's  "see file" function). They fail because required field is missing.

Data like the second row can import.

I am using UTF8 encoding in the plugin's wizard.

BTW I tried latest svn trunk versions, too, but using today's svn trunk, I could not make plugin function (no UI was shown, although plugin installed).

--
GLPI 0.71.5
data_injection 1.5
Ubuntu 2008.10, PHP 5.2.6, apache 2.2, MySQL 5.0.67

Offline

#2 2009-03-26 10:42:09

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: data_injection cannot import data where fields begin with Japanese tex

hello
in you example, what is exaclty the first field ?
and what do you have in your model ?

about the svn, it needs more work to perfectly work on 0.72

Offline

#3 2009-03-26 10:43:41

masonmark
Member
Registered: 2009-03-18
Posts: 12

Re: data_injection cannot import data where fields begin with Japanese tex

Well, I have found out it seems to work if I manipulate data, such that Japanese text is in quote:

CSV data like this can be imported:

"日本語","日本語",abc,123

So, perhaps I was making a mistake?

Anyhow, quoting the data like above does work for us to import Japanese CSV data.

Offline

#4 2009-03-26 10:48:52

masonmark
Member
Registered: 2009-03-18
Posts: 12

Re: data_injection cannot import data where fields begin with Japanese tex

To answer your question, the actual data I used is below. (The useless fields were just from me messing around trying to make it work... sorry for rude language! But this is my actual data I was using.)

I was importing into "Groups".

This did not work for me:

NONE,GROUP_NAME, COMMENT, shitfuck
,RR, no comment, 
,FM, no comment, 
,M&T, no comment, 
,社長, no comment, 
,総務, no comment, 
,役員, no comment,

What would happen, is, it would successfully import groups for the first 3 (English-name) groups, then fail from the 4th one.

The data like below did import ok. The quotes were stripped out automatically and the correct values got into GLPI.

NONE,GROUP_NAME, COMMENT, shitfuck
,"RR", no comment, 
,"FM", no comment, 
,"M&T", no comment, 
,"社長", no comment, 
,"総務", no comment, 
,"役員", no comment,

Offline

#5 2009-03-26 10:49:56

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: data_injection cannot import data where fields begin with Japanese tex

your separator seems to be ,
but in your first line,
日本語、日本語、abc, 123
the first comma in after abdc, so everything from the beginning to abc should be considered as the first field
so the injector is looking for the other fields, and it can't find them

Offline

#6 2009-03-26 14:00:24

masonmark
Member
Registered: 2009-03-18
Posts: 12

Re: data_injection cannot import data where fields begin with Japanese tex

I am sorry, my first post had the wrong wrong data, because I made an error typing it into this forum.

The real data (as shown in post #4)  had correct commas separating the fields. It still did not work with Japanese, until I enclosed the Japanese text in quotes, or put some non-Japanese text before the Japanese words.

Japanese text only failed to import when the field contained text that began with Japanese characters.

Offline

#7 2009-03-26 14:36:49

wawa
GLPI-DEV
From: Montpellier / France
Registered: 2006-07-03
Posts: 6,019
Website

Re: data_injection cannot import data where fields begin with Japanese tex

well you'll have to escape all fields with "
it should work fine this way, as you said

Offline

Board footer

Powered by FluxBB