![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | import-csv missing charakters Hello, Using the powershell cmdlet IMPORT-CSV, special Characters (ä,ö,ü) get lost. My Test: content of af file test.csv: english, german door, tür Powershell: PS C:\Test> $a= ipcsv .\text.csv $a english german ------- ------ door tr If I use instead GET-CONTENT it works the right way: Powershell: PS C:\Test> $a= gc .\text.csv PS C:\Test> $a english, german door, tür I'd like to use IMPORT-CSV as it's more convenient. Any Idea how to handle special characters? Regards, Christoph |
My System Specs![]() |
| | #2 (permalink) |
| Guest | RE: import-csv missing charakters It will work if the format of the file is Unicode : PoSH> Set-Content text.txt -Encoding Unicode @' >> english, german >> door, tür >> '@ >> PoSH> Import-Csv text.txt english german ------- ------ door tür but I think this should also be supported on ANSI and / or an -Encoding parameter on Import-Csv should be provided Greetings /\/\o\/\/ http:/thePowerShellGuy.com "Christoph Jandek" wrote: > Hello, > > Using the powershell cmdlet IMPORT-CSV, special Characters (ä,ö,ü) get lost. > > My Test: > > content of af file test.csv: > english, german > door, tür > > Powershell: > PS C:\Test> $a= ipcsv .\text.csv > $a > english german > ------- ------ > door tr > > If I use instead GET-CONTENT it works the right way: > > Powershell: > PS C:\Test> $a= gc .\text.csv > PS C:\Test> $a > english, german > door, tür > > I'd like to use IMPORT-CSV as it's more convenient. > Any Idea how to handle special characters? > > Regards, > Christoph > |
My System Specs![]() |
| | #3 (permalink) |
| Guest | RE: import-csv missing charakters Thank you for the fast response. It works fine with Unicode or UTF-8. The errrors occur with an ASCII-File, which was created by an Exchange 5.5 export. I can pipe the ASCII-File to an Unicode File for using IMPORT-CSV. Or is there a better way, as GET-CONTENT works fine? Regards, Christoph "/\/\o\/\/ [MVP]" wrote: > It will work if the format of the file is Unicode : > > PoSH> Set-Content text.txt -Encoding Unicode @' > >> english, german > >> door, tür > >> '@ > >> > > PoSH> Import-Csv text.txt > > english german > ------- ------ > door tür > > but I think this should also be supported on ANSI and / or an -Encoding > parameter on Import-Csv should be provided > > Greetings /\/\o\/\/ > http:/thePowerShellGuy.com > > > "Christoph Jandek" wrote: > > > Hello, > > > > Using the powershell cmdlet IMPORT-CSV, special Characters (ä,ö,ü) get lost. > > > > My Test: > > > > content of af file test.csv: > > english, german > > door, tür > > > > Powershell: > > PS C:\Test> $a= ipcsv .\text.csv > > $a > > english german > > ------- ------ > > door tr > > > > If I use instead GET-CONTENT it works the right way: > > > > Powershell: > > PS C:\Test> $a= gc .\text.csv > > PS C:\Test> $a > > english, german > > door, tür > > > > I'd like to use IMPORT-CSV as it's more convenient. > > Any Idea how to handle special characters? > > > > Regards, > > Christoph > > |
My System Specs![]() |
| | #4 (permalink) |
| Guest | Re: import-csv missing charakters get-content defaults to reading in utf8 encoding, hence why it works. import-csv, for some unknown reason, is defaulting to ascii encoding. So your workaround cat test.csv > test2.csv # make utf8 should work until they fix import-csv. -- William Stacey [C# MVP] PowerLocker, PowerPad www.powerlocker.com "Christoph Jandek" <ChristophJandek@discussions.microsoft.com> wrote in message news:45FED266-2CDF-4191-B854-4945B52DFE02@microsoft.com... | Thank you for the fast response. | | It works fine with Unicode or UTF-8. | The errrors occur with an ASCII-File, which was created by an Exchange 5.5 | export. | | I can pipe the ASCII-File to an Unicode File for using IMPORT-CSV. | Or is there a better way, as GET-CONTENT works fine? | | Regards, | Christoph | | | | "/\/\o\/\/ [MVP]" wrote: | | > It will work if the format of the file is Unicode : | > | > PoSH> Set-Content text.txt -Encoding Unicode @' | > >> english, german | > >> door, tür | > >> '@ | > >> | > | > PoSH> Import-Csv text.txt | > | > english german | ------ | > door tür | > | > but I think this should also be supported on ANSI and / or an -Encoding | > parameter on Import-Csv should be provided | > | > Greetings /\/\o\/\/ | > http:/thePowerShellGuy.com | > | > | > "Christoph Jandek" wrote: | > | > > Hello, | > > | > > Using the powershell cmdlet IMPORT-CSV, special Characters (ä,ö,ü) get lost. | > > | > > My Test: | > > | > > content of af file test.csv: | > > english, german | > > door, tür | > > | > > Powershell: | > > PS C:\Test> $a= ipcsv .\text.csv | > > $a | > > english german | > > ------- ------ | > > door tr | > > | > > If I use instead GET-CONTENT it works the right way: | > > | > > Powershell: | > > PS C:\Test> $a= gc .\text.csv | > > PS C:\Test> $a | > > english, german | > > door, tür | > > | > > I'd like to use IMPORT-CSV as it's more convenient. | > > Any Idea how to handle special characters? | > > | > > Regards, | > > Christoph | > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't Import | deedee | Vista mail | 0 | 09-01-2008 12:30 PM |
| IMPORT FROM WM TO WLM | Lindsay Graham | Live Mail | 4 | 03-18-2008 12:29 AM |
| Missing Drivers That Aren't Really Missing | Bad Santa | Drivers | 4 | 11-04-2007 07:22 AM |
| Movie Maker - Missing Photos not missing Links | =?Utf-8?B?TWVs?= | Vista General | 0 | 08-14-2006 11:23 AM |
| Import-Csv | THG | PowerShell | 2 | 07-02-2006 02:43 PM |