![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Standard output encoding Hi, I want to use a powershell script for CGI. Naturally for this I need the output to be in ASCII. It seems like out-file -encoding ascii doesn't help here, because there is no /dev/stdout that I would use in unix (or is there?). out-host, out-* on the other hand is missing the -encoding option. Obviously I'm missing something... Any hint? harti |
My System Specs![]() |
| | #2 (permalink) |
| | RE: Standard output encoding If you want the file to contain ASCII encoded data then I think you need to use out-file as you describe. What exactly are you trying to accomplish? Are you producing a file to be read by a unix system? This article regarding files produced by powershell and then being read by VBScript may help http://richardsiddaway.spaces.live.c...3E96!175.entry -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "harti" wrote: > Hi, > > I want to use a powershell script for CGI. Naturally for this I need the > output to be in ASCII. It seems like out-file -encoding ascii doesn't help > here, because there is no /dev/stdout that I would use in unix (or is > there?). out-host, out-* on the other hand is missing the -encoding option. > Obviously I'm missing something... Any hint? > > harti |
My System Specs![]() |
| | #3 (permalink) |
| | RE: Standard output encoding "RichS" wrote: > If you want the file to contain ASCII encoded data then I think you need to > use out-file as you describe. What exactly are you trying to accomplish? > Are you producing a file to be read by a unix system? I need the standard output to be ASCII. That is what IIS or Apache expect. So out-file doesn't help, because I have no filename to specify. harti |
My System Specs![]() |
| | #4 (permalink) |
| | RE: Standard output encoding Could you use the WSH COM objects in your script to pass the data across to IIS? -- Richard Siddaway Please note that all scripts are supplied "as is" and with no warranty Blog: http://richardsiddaway.spaces.live.com/ PowerShell User Group: http://www.get-psuguk.org.uk "harti" wrote: > > > "RichS" wrote: > > > If you want the file to contain ASCII encoded data then I think you need to > > use out-file as you describe. What exactly are you trying to accomplish? > > Are you producing a file to be read by a unix system? > > I need the standard output to be ASCII. That is what IIS or Apache expect. > So out-file doesn't help, because I have no filename to specify. > > harti > |
My System Specs![]() |
| | #5 (permalink) |
| | Re: Standard output encoding You can use the $OutputEncoding variable to set the encoding for input to native applications: PS> $OutputEncoding = [Text.Encoding]::ASCII Here's a blog entry that describes OutputEncoding a bit more: http://blogs.msdn.com/powershell/arc...he-rescue.aspx -- Nigel Sharples [MSFT] Windows PowerShell Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "harti" <harti@discussions.microsoft.com> wrote in message news:904B94E2-9F77-421D-B738-E12772D659FC@microsoft.com... > Hi, > > I want to use a powershell script for CGI. Naturally for this I need the > output to be in ASCII. It seems like out-file -encoding ascii doesn't help > here, because there is no /dev/stdout that I would use in unix (or is > there?). out-host, out-* on the other hand is missing the -encoding > option. > Obviously I'm missing something... Any hint? > > harti |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Add-Content -Encoding UTF8 and -Encoding Unicode Powershell bugs | PowerShell | |||
| Standard output redirecting | PowerShell | |||
| encoding | Vista mail | |||
| Standard output and standard error merging to a log file | PowerShell | |||
| Redirection of standard out and standard error | PowerShell | |||