How to open registry file both ASCII and Unicode versions

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: JohnH (GoOnSpamMeIf_at_You.dare)
Date: 05/30/04

  • Next message: Balboos: "Re: Application Specific Font ?"
    Date: Sun, 30 May 2004 21:30:32 +0100
    
    

    Hi,

    In my program i need to open a windows registry export file (both older
    ASCII REGEDIT4 and unicode regedit 5 formats) and parse the file for my
    programs requirements.

    The project is not and cannot be built as unicode (for other reasons).
    Once the file is opened I need to parse the file, read keys + values
    etc...

    Question is how do i do this?

    I have used CStdioFile, open as typeBinary and then
    fgetws(wcBuffer, nMax, importFile.m_pStream)

    Which works for unicode files, but how do i test whether a file is ASCII
    or Unicode in the first place?

    Any help would be much appreaciated,
    Thanks in advance

    -- 
    John
    

  • Next message: Balboos: "Re: Application Specific Font ?"

    Relevant Pages

    • Re: JSON.parse and unicode escape?
      ... I am running into what seems to be a related problem with the ... I don't know enough about unicode to really understand what is being ...
      (comp.lang.ruby)
    • Re: Anyway to designating the encoding of the "source" for compile?
      ... > app) is decode your user input into Unicode (you *don't* need to ...
      (comp.lang.python)
    • Re: Filename Encoding Help
      ... If this file is opened on a Windows with a mismatching system code page, ... if you can parse the first line and get the code page. ... You can then use that to conver to Unicode. ... So you will be able to use a Japanese-encoded file even on a Korean ...
      (microsoft.public.dotnet.framework)
    • Re: quoted-printable characters
      ... This is where I got into trouble. ... I can't seem to find any way to parse EVERYTHING to Unicode. ... For additional commands, e-mail: beginners-help@xxxxxxxx ...
      (perl.beginners)
    • Re: SetClipBoard returns Junk characters!
      ... But you shouldn't need to store the two formats; ... I posted to you in this thread two routines to copy Unicode text to the ... other using CF_TEXT with a CW2A conversion, ... SetClipboardData(CF_UNICODETEXT, ... ...
      (microsoft.public.vc.mfc)