Author Topic: Strange chars in TAR file  (Read 2324 times)

0 Members and 1 Guest are viewing this topic.

Offline anddan

  • Occasional poster
  • *
  • Posts: 3
    • View Profile
Strange chars in TAR file
« on: January 27, 2008, 07:45:41 PM »
Hello. My first post :)  I've been searching and havent quite found my problem on the forum. The swedish chars ÅÄÖ looks ok on files presented in the browser, but when archived with tar they get switched to something else?! Looks like some kind of dos-codepage to me. Am i doing something wrong, is it a feature :) or simply a bug?
All in all a great program imho.

Ps. sorry if this has already been addressed..

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Strange chars in TAR file
« Reply #1 on: January 30, 2008, 07:42:23 PM »
hi anddan, and thank for reporting :)
i added a file Å.txt to HFS
then downloaded the tar from HFS
when i opened the file using Total Commander, all went good.
so far so good.

when i opened it with 7zip, the character was wrong.
so i made another test: archived the file with 7zip itself. This new tar was opened finely by 7zip, but not by Total commander.

Who's right? Who's wrong?
I looked at the character's code: HFS used code C5, while 7zip 8F.
On my system the right code for Å is C5.
Hard to say, but i think TC and HFS are right, 7zip is wrong, because
1. i checked an ASCII table on my system, and it reports code C5 for Å
2. i created a tar using the GNU Tar, a true landmark about tar files, and it used C5
 (i also tried to extract the HFS tar using GNU Tar, and it worked finely)

So, i guess that could be considered a bug of the software you are using to open the tar.

But i may be wrong, and i'm open to read about other opinions.
Can you provide more information of your problem?

Offline anddan

  • Occasional poster
  • *
  • Posts: 3
    • View Profile
Re: Strange chars in TAR file
« Reply #2 on: February 05, 2008, 10:33:04 PM »
Thank you for looking into it! Have to apologize for my lazy respons, been a little busy  :P Didn't cross my mind that the problem could actually be the zip-application i used, but you where absolutely right. I tried it with some other zip apps and it worked like a charm  :) (Might even be some setting i didnt care to look into so the zipp app might be ok too, but the one that caused strange chars was the portable version of IZArc called IZArc2Go fyi.)

So ty, and keep up the good work! :)

Offline anddan

  • Occasional poster
  • *
  • Posts: 3
    • View Profile
Re: Strange chars in TAR file
« Reply #3 on: February 05, 2008, 11:07:06 PM »
A little update:
I did some testing, not sure if this helps but the chars that i got are the same you would get from cmd if the input has been from Windows, i.e. if you encode a textfile in Windows ANSI (cp1252) and look at it through a DOS prompt wich (at least on my system, think its European standard though) uses cp850 you get the same phenomena of switched chars. What encoding are your TAR routine using? Is it an explicit choice of codepage or "system default", if the latter i guess its Microsoft ANSI.

I've done some simple textapps in C# and this is - at least to me :) - a problem that i bumped into several times, since DOS, Windows and the framework wants different ways of encoding their files.

Offline rejetto

  • Administrator
  • Tireless poster
  • *
  • Posts: 12949
    • View Profile
Re: Strange chars in TAR file
« Reply #4 on: February 07, 2008, 03:24:26 AM »
yes, i already noticed it actually uses the "dos" codepage.
I guess this can be considered wrong, since you watch files using the windows codepage.