CSV Buffer encoding trick

Miklos_Hollender
Member Posts: 1,598
So I am reading some Amazon files with the CSV Buffer and I keep seeing strange characters in Spanish or French names. Hm. Thought encoding problems are a thing of the past. I play with importing the file into Excel with the various encodings until it turns out the characters display best with UTF-8. Which is to be expected, most popular encoding these days.
Looking into the CSV Buffer table, I see in InitializeReader Encoding.Default instead of Encoding.UTF8. That was the culprit. My solution was to copy this function and the LoadData that calls it into new functions and make encoding choosable by a parameter to LoadData's copied version.
Looking into the CSV Buffer table, I see in InitializeReader Encoding.Default instead of Encoding.UTF8. That was the culprit. My solution was to copy this function and the LoadData that calls it into new functions and make encoding choosable by a parameter to LoadData's copied version.
0
Answers
-
Hi,
I´m not sure if CSV buffer table is something new, I only know table 370, excel buffer.
For importing CSV files I would suggest:
-Open with notepad (click view>status bar) or notepad++ and check the enconding. As you´ve said UTF8 works best. If it is something else, I´ve found you this old function (https://mibuso.com/downloads/ansi-ascii-converter)
-Create a xmlport for imports. set enconding UTF8. You can find many examples in xml ports, try find something like "import" and use that one as template.
-You can use this also, it is very usefull when you have like 30 fields to import, helps a lot https://mibuso.com/downloads/dynamics-nav-xmlport-generator-v1.3
-i usually like to set autoinsert and autpupdate properties off. I do all by myself in beforeimport trigger.
hope this helps.
1 -
CSV Buffer table completely sucks because it does not care about quotation marks. That is, it does not recognize that "Paris, France" is one field, not two fields. Have to rewrite my whole import as an XMLPort.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions