Developer forum

Forum » Development » eCom import of special characters

eCom import of special characters


Reply

I have a problem importing new lines (br tags) and asian text using eCom XML import.

 

I can enter new lines and asian text in the long description for a product using the rich text editor. If I export this and import it in the same format it was exported, the asian characters become garbage and the br tags become actual text (i.e. it actually displays <br/> when viewing the product).

 

Is there a working way to import asian text and new lines using eCom XML import?

 

I am using your standard XML import and export pipelines and my XML is utf-8 encoded.


Replies

 
Reply
mikj@stibo.com wrote:

I have a problem importing new lines (br tags) and asian text using eCom XML import.

 

I can enter new lines and asian text in the long description for a product using the rich text editor. If I export this and import it in the same format it was exported, the asian characters become garbage and the br tags become actual text (i.e. it actually displays <br /> when viewing the product).

 

Is there a working way to import asian text and new lines using eCom XML import?

 

I am using your standard XML import and export pipelines and my XML is utf-8 encoded.

Any word on this?

 

I'm sure this will be an issue for me also in just a couple of weeks.

 

Rasmus Vork

 
Reply

Could you please try the following:

 

 - Export the data to an XML file

 - Open the XML file in NOTEPAD

 - Choose "Save as" and Choose UTF-8 in Encoding.

 - Do an import of the new file

 

The Description is a CDATA section, right?

 
Reply

Thanks, Lars

 

(I am the original poster but my account had been deleted, so I used my colleagues login to post it.)

 

No, the description is not a CDATA section. I've never seen that used in your examples, and that's not when I get when I export from eCom either.

 

But it's a good idea and I will try it tomorrow when I get the time.

 

By the way, when I try to import an XML file that was exported from eCom I always have to fix some problems to avoid some kind of reference error when importing.

 

Best regards,

Carsten

 
Reply

What references are those? That's just about the only instance where I never experience any problems;)

 
Reply
Sorensen wrote:

What references are those? That's just about the only instance where I never experience any problems;)

I too have not experienced problems with XML import (haven't tried it with special characters though).

 

On the other hand, a CSV import seems rather impossible. It won't even support the .csv the module exports!

 

 

Rasmus Vork

 
Reply

What problems do you experience when importing from csv?

 
Reply
Sorensen wrote:

What problems do you experience when importing from csv?

This probably should be in a completely different thread, but here we go. Sorry for a, probably, bad english translation. This is pasted from a case of mine.

 

 

I've tried to export all products as a .csv. Works just fine.

But if i try to import this exact same file as the export created, I'm just recieving errors.

 

I've tried both user created pipelines and your wizard interface for this, with the same result. Only difference if the error message.

 

In my user created pipeline the error occurs in the XML to CSV step, with an error concerning that '#' can not be in a Name. But it's not!

 

In the wizard interface the error is an index out of bounds.

 

What is happening?

 

 

 

I really should mention that i have no experience with import/export and nothing more than a basic understanding of a database structure.

 

 

 

Rasmus Vork

 
Reply

Oh, if you already submitted a helpdesk case, I'm sure someone will deal with it.

 

I've had a similar problem, which I was able to work around by adding a linebreak at the beginning of the csv file.

 
Reply
Sorensen wrote:

Could you please try the following:

 

 - Export the data to an XML file

 - Open the XML file in NOTEPAD

 - Choose "Save as" and Choose UTF-8 in Encoding.

 - Do an import of the new file

 

The Description is a CDATA section, right?

OK, returning to the original subject of this thread...

 

I have tried what you suggested.

 

Using a CDATA section made no difference. Of course my tags were escaped when they were not in a CDATA section, and when using a CDATA section I no longer escape them. It did not make a difference.

 

This is my XML:

 

<?xml version="1.0" encoding="utf-8" ?>
<Products>
<Product>
  <ProductID>Test2348</ProductID>
  <ProductLanguageID>LANG1</ProductLanguageID>
  <ProductNumber>Test2348</ProductNumber>
  <ProductName>Special characters test</ProductName>
  <ProductLongDescription><![CDATA[Special characters test <br/>
Asian characters: 麦卡伦18年橡木威士
<br/>
Text after line break
]]></ProductLongDescription>
  <ProductStock>1</ProductStock>
  <ProductActive>True</ProductActive>
  <ProductUnits/>
  <ProductRelatedGroups/>
  <ProductCustomFields/>
  <ProductPrice>169</ProductPrice>
  <ProductGroups>
    <GroupID>GROUP1</GroupID>
  </ProductGroups>
</Product>
</Products>
 

The problem is that the <br/> tags don't create actual line breaks. The output simply shows <br/> which is not the intention. I know that it's possible to store both these tags and Asian characters in the system because it works if you enter it into the rich text editor.

 

I also tried your exercise with Notepad. I'm not sure what the point was, but it also had no effect. Rest assured that I know how to deal with UTF-8 and Asian characters as that is part of my work.

 

Instead of suggesting more exercises could you please try to import XML with text that contains <br/> tags, and let me know how it is supposed to work with an XML example.

 

Thanks for your support,

Carsten

 

 

Oh, and by the way, the reference errors I mentioned occur if I don't include the following in my product XML:

  <ProductUnits/>
  <ProductRelatedGroups/>
  <ProductCustomFields/>
This is not included when I export XML from eCom.

 

 
Reply

Hum, weird. I copied the XML from your post and saved it to an XML file using Notepad. I set up a pipeline containing these activities:

 

XML File Source

 - Root element: Products

 - XPath: //Products/Product

 - File: The newly created file

 

Product Destination

 - Just pointed out a group to import to

 

At first try I received an error that the ProductCustomFields had incomplete content. I removed that node from the XML, and then it worked as it should. This screendump shows the content of the long description field after import: http://developer.dynamicweb.dk/Files/Billeder/Replyid1993.png

 

Are you using the most recent assemblies? A lot of changes were made to Import/Export in that release, so that migt give a clue, why it works for me and not for you.

 
Reply
Sorensen wrote:

Are you using the most recent assemblies? A lot of changes were made to Import/Export in that release, so that migt give a clue, why it works for me and not for you.

You are right! I did not update to the most recent version. I must admit that I'm not sure how best to update. How do I avoid loosing my template changes? And do I have to update my database with the newest empty database or can I keep the old one?

 

Anyway, I'm happy to hear that the problem is resolved in the newest version, so I am more motivated to update now :-)

 

Thanks for your support,

Carsten

 
Reply

In the "SDK - Solution Installation" available here http://documentation.dynamicweb.dk/Development-23323.aspx section 2.1.5 contains information on upgrading your solution. But in short terms you paste the content of the Application folder onto your standard solution, and then you copy the assemblies from the new application to the bin folder of your custom solution. Databases and File archive are automatically updated the first time you run Dynamicweb after updating, so you shouldn't have to do anything about the template

 

You must be logged in to post in the forum