NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) Slimm GB-PVR and GBPVRcli v
« Previous 1 2 3 4 Next »
garbled text

 
  • 0 Vote(s) - 0 Average
garbled text
gkovacsp
Offline

Member

Posts: 62
Threads: 15
Joined: Mar 2007
#1
2007-10-16, 06:15 PM
This is most probably not a slimmgbpvr problem, but I can't find a solution and couldn't find a help anywhere.

I export the currently recorded show's title into a textfile. Since I live in Hungary the titles will have hungarian characters in them.
Example file content:
Code:
Kikötő - Háttér

If I read this file with the following command:
Code:
@for /f "usebackq tokens=1 delims=§" %%G IN ("C:\lock-recording.txt") DO SET show=%%G
then Echo it to the screen:
Code:
echo %show%
then I'll have some garbled text printed:
Code:
KikA6tA - HA!ttA)r

So I'm just wondering if anyone have a solution for this... To see the same on the screen as in the file.

I know it is a character codepage problem, but don'T know the solution.

I Use a hungarian Windows XP.

Thanks in advance!
K.S.
Offline

Senior Member

Posts: 526
Threads: 12
Joined: Oct 2006
#2
2007-10-17, 09:38 AM
i doubt you'll be able to change the output. GBPVRCli is using the ANSI codepage used by windows. i could not find a way to change that under DOS. chcp should change the codepage under DOS, you might search with google for a solution Wink
sub Wrote:Yep, what he said.

curiosity killed the cat Big Grin
gkovacsp
Offline

Member

Posts: 62
Threads: 15
Joined: Mar 2007
#3
2007-10-17, 09:47 AM
K.S. Wrote:i doubt you'll be able to change the output. GBPVRCli is using the ANSI codepage used by windows. i could not find a way to change that under DOS. chcp should change the codepage under DOS, you might search with google for a solution Wink

I've tried CHMOD, but couldn't figure out the right way...
Mister Slimm
Offline

Senior Member

Posts: 437
Threads: 41
Joined: Nov 2005
#4
2007-10-17, 10:14 AM
Does the text file contain the correct text if you open it in a text editor or word processor?
[SIZE="1"]Akasa Zen case, AMD Phenom II X3 720, 4.00Gb Ram, Sapphire ATI Radeon 4890, Terratec Terratec Cinergy 2400i Twin Digital Tuner, 1050Gb storage, Windows 7 Home Premium.
See my blog for releases, HD wallpapers, movie, game and anime reviews and more.[/SIZE]
gkovacsp
Offline

Member

Posts: 62
Threads: 15
Joined: Mar 2007
#5
2007-10-17, 10:18 AM
Everything is fine then. I see the funky hungarian characters correctly.

Only if I echo its content to the screen using the above described command, I get crap instead of the hungarian letters.
Mister Slimm
Offline

Senior Member

Posts: 437
Threads: 41
Joined: Nov 2005
#6
2007-10-17, 10:38 AM
As the text in the file is fine, this means that GBPVRcli is working okay.

What happens if you '@TYPE' the file to the screen instead of using the FOR loop. It's probably the FOR loop that is causing the problems.

You can use GBPVRcli to format the output however you want.

To change the codepage use the command CHCP. The codepages for Hungary are 852 or 850, eg, 'CHCP 852'. Typing in CHCP without any arguments tells you the current codepage.
[SIZE="1"]Akasa Zen case, AMD Phenom II X3 720, 4.00Gb Ram, Sapphire ATI Radeon 4890, Terratec Terratec Cinergy 2400i Twin Digital Tuner, 1050Gb storage, Windows 7 Home Premium.
See my blog for releases, HD wallpapers, movie, game and anime reviews and more.[/SIZE]
gkovacsp
Offline

Member

Posts: 62
Threads: 15
Joined: Mar 2007
#7
2007-10-17, 10:53 AM
Mister Slimm Wrote:To change the codepage use the command CHCP. The codepages for Hungary are 852 or 850, eg, 'CHCP 852'. Typing in CHCP without any arguments tells you the current codepage.

As I stated at the top I'm not blaming gbpvrcli, it is just a problem, which came up in my process of printing the data to the screen, or sending it through MSN as status message.

I'll give some more tries to the TYPE command tonight, thank you for your attention.
K.S.
Offline

Senior Member

Posts: 526
Threads: 12
Joined: Oct 2006
#8
2007-10-17, 01:22 PM
gkovacsp Wrote:As I stated at the top I'm not blaming gbpvrcli, it is just a problem, which came up in my process of printing the data to the screen, or sending it through MSN as status message.

I'll give some more tries to the TYPE command tonight, thank you for your attention.

if that's your only sorrow: do it via vbs ;-)
the following bat & vbs would read your file & generate a messagebox. replace the messagebox with your desired action Wink
tested with german umlaut Big Grin

test.bat
Code:
wscript c:\temp\test.vbs

test.vbs
Code:
Const ForReading = 1
Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\temp\test.txt", ForReading)

strText = objFile.ReadAll
objFile.Close

Wscript.Echo strText
sub Wrote:Yep, what he said.

curiosity killed the cat Big Grin
gkovacsp
Offline

Member

Posts: 62
Threads: 15
Joined: Mar 2007
#9
2007-10-22, 05:29 PM
Neither of the above methods seems to work for me, it looks I have to live with the garbled text or fleed to a country, which uses the western codepage Smile

I've attached the text file created by GBPVRCLI.

If I echo that to a console I get the strange characters.

I figured out, that the file is utf-8 encoded, so if I open it in a regular text editor it will recognize it correctly and displays correctly.

If I read it into a BAT file and echo to the screen, life is not so sunny any more.
Code:
@for /f "usebackq tokens=1 delims=§" %%G IN ("C:\lock-recording.txt") DO SET show=%%G
echo %show%

If anyone has any time to waste on it, then thanks a lot in advance.
K.S.
Offline

Senior Member

Posts: 526
Threads: 12
Joined: Oct 2006
#10
2007-10-23, 08:12 AM
gkovacsp Wrote:Neither of the above methods seems to work for me, it looks I have to live with the garbled text or fleed to a country, which uses the western codepage Smile

what's wrong with my workaround using vbs? i've tried your text, it's working on my machine Wink see attached screenshot

i've used the following batch

Code:
@for /f "usebackq tokens=1 delims=§" %%G IN ("C:\temp\test.txt") DO SET show=%%G
echo %show%

wscript c:\temp\test.vbs
sub Wrote:Yep, what he said.

curiosity killed the cat Big Grin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  GBPVRcli - extract information from GB-PVR for use in batch and text files Mister Slimm 2 9,576 2007-02-20, 01:40 PM
Last Post: Mister Slimm

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode