in reply to win32::ole - SaveAs( )

your $savename isn't treated as unicode, actually.

Try Encode::decode("cp1251",$savename);
If this fails, you can enforce for it to be treated as Unicode using OLE Variant, see perldoc Win32::OLE::Variant

addition FileFormat => wdFormatUnicodeText actually about file format (rtf etc) and not about file name.

Replies are listed 'Best First'.
Re^2: win32::ole - SaveAs( )
by karavay (Beadle) on Oct 01, 2007 at 17:10 UTC
    sry vkon maybe i got u wrong but, it is about the contents of the file and not about its name.

    the content of the doc file should be read and saved without losing its Unicode.

    Thanks for your reply,
      ... then you should use either wdFormatEncodedText or wdFormatUnicodeText but you must use strict; first, which will reveal your error in its usage.

      you use Word's constants incorrectly actually wdFormatUnicodeText has some small digit value (do not have it handy)

      Use Win32::OLE::Const->Load(....); to reveal OLE constant values.

        use strict is acually used and the code comples without any arror - this is the only small part of the program that ive posted here - i've tried using wdFormatEncodedText and wdFormatUnicodeText, but it does not preserve unicode the resulting text comes as a bunch of - "?????????"
        use strict is acually used and the code comples without any arror - this is the only small part of the program that ive posted here -

        i've tried using wdFormatEncodedText and wdFormatUnicodeText, but it does not preserve unicode the resulting text comes as a bunch of - "?????????"