How to Convert Codepage 1250 to 852 (middle Europe) to import text

NAVFuchs
Member Posts: 77
Hi,
I want to import text (just once for setup) in NAV 2009 R2 codepage 1250 text. As I understand, I have to convert to codepage 852 to
import it per Dataport.
Does anybody know how to convert it in a correct way. A solution via Notepad++ would be also fine.
Did't geht the right way so far.
Thanks.
I want to import text (just once for setup) in NAV 2009 R2 codepage 1250 text. As I understand, I have to convert to codepage 852 to
import it per Dataport.
Does anybody know how to convert it in a correct way. A solution via Notepad++ would be also fine.
Did't geht the right way so far.
Thanks.
0
Answers
-
Could this perhaps do the trick for you?
https://www.hanselman.com/blog/HowToConvertATextFileWithASpecificCodepageToUTF8UsingVisualStudioNET.aspxDon't just take my word for it, test it yourself0 -
I have written PowerShell scripts for this. All you need to do is to exchange your required codepage numbers in the script.
http://www.msdynamics.de/viewtopic.php?f=17&t=25726
In your case it would look like this:Function Convert_ANSI1250_OEM852 { $args = resolve-path $args $WorkingFolder = Split-Path -Parent $args $sourceEncoding = [System.Text.Encoding]::GetEncoding(1250) $targetEncoding = [System.Text.Encoding]::GetEncoding(852) $convertedFileName = [System.IO.Path]::GetFileNameWithoutExtension($args) +"_OEM852" + [System.IO.Path]::GetExtension($args) $convertedfile = New-Item -path "$WorkingFolder\$convertedFileName" -type file $textfile = [System.IO.File]::ReadAllText($args, $sourceencoding) [System.IO.File]::WriteAllText($convertedfile, $textfile, $targetencoding) Write-host $args 'converted to' $convertedFileName }
Call the function together with the path to your source file, the converted one will be written to the same folder.
Keep in mind that further processing into NAV requires your OS regional settings to have a country in middle europe that uses these codepages (like PL, CZ, etc.) as well for the special characters to look right (also for the Windows editor, in Notepad++ you can change the codepage encoding settings to check the result visually beforehand).Kai Kowalewski0 -
-
I think I used this one in the past : https://mibuso.com/downloads/ansi-ascii-converter.
I also found another one : https://mibuso.com/downloads/convertasciitoansi-fob-example
All nicely inside C/AL without .exe, .dll, or PoSh.Regards,Alain Krikilion
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!0 -
Keep in mind that most ANSI2ASCII-tools were made from the viewpoint of codepages in Western Europe.
Western Europe, Skandinavia, also Estonia
ANSI = Codepage 1252
ASCII = Codepage 850
In Central/Eastern Europe (without Baltic States)
ANSI = Codepage 1250
ASCII = Codepage 852
Baltic States
ANSI = Codepage 1257
ASCII = Codepage 775
That's why I created these scripts. You can easily adjust them for all purposes.Kai Kowalewski0
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