Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Character encoding - Accent in username and / or password #10

Closed
PoLaKoSz opened this issue Jul 7, 2018 · 13 comments
Closed

Character encoding - Accent in username and / or password #10

PoLaKoSz opened this issue Jul 7, 2018 · 13 comments
Labels
help wanted Extra attention is needed

Comments

@PoLaKoSz
Copy link

PoLaKoSz commented Jul 7, 2018

Hi!

Thank You for the app!

When I have a Firefox column like this:

hostname username password
https://github.com PoLáKoSz PoLáKoSz

when I save it to .csv or .json it will become to this:

hostname username password
https://github.com PoLáKoSz PoLáKoSz

Solution

Fix for .json

  1. Open with Sublime Text with the .json file
  2. File > Save with Encoding > Western (ISO 8859-1)
  3. Reopen Sublime Text with the file

Fix for .csv

  1. Open with Sublime Text with the .csv file
  2. File > Save with Encoding > Western (ISO 8859-1)
  3. Open Excel with a new blank sheet
  4. Data > From Text (or something similar)
  5. FIle origin: Unicode (UTF-8)
Screenshot

Excel Import Wizard

@kspearrin
Copy link
Owner

What if you change the encoding of the downloaded file to UTF8? What program are you opening the file with?

@PoLaKoSz
Copy link
Author

PoLaKoSz commented Jul 7, 2018

Sorry I forgot to append the specs.

  • Firefox Quantum 61.0.1 (64-bit)
  • FF Password Exporter Portable 1.0.1.exe
  • opened .json with Sublime Text 3.1.1 Build 3176
  • opened .csv with Microsoft Office 2007

I don't really find any options to set the encoding to UTF-8 in the FF-PE.

@kspearrin
Copy link
Owner

I am not sure. It sounds like an encoding problem of some sort.

@kspearrin kspearrin added the help wanted Extra attention is needed label Jul 9, 2018
@PoLaKoSz
Copy link
Author

PoLaKoSz commented Jul 9, 2018

I am not an expert in JavaScript nor encoding / decoding but maybe somewhere here cause something problems.

username: username.data,
password: password.data,

I found this table.

@cdelarge3
Copy link

It looks like Firefox may have changed something in how the usernames and passwords are stored (encrypted?). The websites are showing fine, but the username and password fields are trash. FF Quantum 61.0.1. Any thoughts?

@E3V3A
Copy link

E3V3A commented Aug 25, 2018

@PoLaKoSz If you are viewing this in Sublime, you need to set the file encoding to UTF8.

@PoLaKoSz
Copy link
Author

PoLaKoSz commented Aug 26, 2018

Thank You @E3V3A for the suggestion but it didn't work for me but You gave me a good hint.

This worked for me:

  1. Open with Sublime Text the .json or .csv file
  2. File > Save with Encoding > Western (ISO 8859-1)
  3. Reopen Sublime Text with the file

Updated my question with the solutions for .json and .csv files.

@E3V3A
Copy link

E3V3A commented Apr 19, 2019

Although I am not running this app, I can only point out to have a deeper look at how your system is setup in regard to charcter coding. Including the fonts used in your Windows shells.

  • Look at the default encoding for your firefox
  • Look at the default encoding for your powershell
  • Look at the font used in your powershell (not all fonts support all characters
  • Look at the default character coding for your system
  Console Settings:
      Type              : ConsoleHost
      OutputEncoding    : Unicode (UTF-8)
      Color Capability  : 151
      Registry VT Level : 1
      CodePage (input)  : 437
      CodePage (output) : 437

You can get some of these with powershell:

(Get-Variable OutputEncoding).Value.EncodingName
(Get-ItemProperty -path "HKCU:\Console" -name ScreenColors).ScreenColors
(Get-ItemProperty -path "HKCU:\Console" -name VirtualTerminalLevel).VirtualTerminalLevel
[console]::OutputEncoding.CodePage
[console]::InputEncoding.CodePage
chcp.com

If you have WSL, you can also check with locale.

In general, avoid using anything else than UTF-8 for your OS wide font encoding, unless you are in a font specific language like Chinese, Japanese, Korean etc.

@E3V3A
Copy link

E3V3A commented Apr 19, 2019

PS. What does this do?

    function toArray(str) {
        const arr = new Uint8Array(str.length);
        for (let i = 0; i < str.length; i++) {
            arr[i] = str.charCodeAt(i);
        }
        return arr;
    }
  • IIRC UTF-8 characters consists of 4 bytes each...

@kspearrin
Copy link
Owner

@E3V3A Converts to a UTF8 string to a byte array.

@PoLaKoSz
Copy link
Author

Thank You @E3V3A for the information!

I am not realy familiar with PowerShell so I just copied Your script and this is what I got back:

PS C:\WINDOWS\system32> (Get-Variable OutputEncoding).Value.EncodingName
US-ASCII
PS C:\WINDOWS\system32> (Get-ItemProperty -path "HKCU:\Console" -name ScreenColors).ScreenColors
7
PS C:\WINDOWS\system32> (Get-ItemProperty -path "HKCU:\Console" -name VirtualTerminalLevel).VirtualTerminalLevel
Get-ItemProperty : Property VirtualTerminalLevel does not exist at path HKEY_CURRENT_USER\Console.
At line:1 char:2
+ (Get-ItemProperty -path "HKCU:\Console" -name VirtualTerminalLevel).V ...
+  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (VirtualTerminalLevel:String) [Get-ItemProperty], PSArgumentException
    + FullyQualifiedErrorId : System.Management.Automation.PSArgumentException,Microsoft.PowerShell.Commands.GetItemPr
   opertyCommand

PS C:\WINDOWS\system32> [console]::OutputEncoding.CodePage
437
PS C:\WINDOWS\system32> [console]::InputEncoding.CodePage
437
PS C:\WINDOWS\system32> chcp.com
Active code page: 437

@kspearrin
Copy link
Owner

Does 149878a solve the problem?

@PoLaKoSz
Copy link
Author

Yes, so i am gonna close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants