in reply to Re^3: Need Help Porting XS Modules to Windows
in thread Need Help Porting XS Modules to Windows

appears to be entirely valid

Exactly! :)

Someone had forgotten a ZERO WIDTH NO-BREAK SPACE (which is encoded to ef bb bf in UTF-8) in the beginning of the file. Programmers' text editors usually highlight such "strange" characters, but in this case, my copy of Vim says that a three-byte file with this code point consists of "0 lines and 3 characters", but looks entirely empty.

Replies are listed 'Best First'.
Re^5: Need Help Porting XS Modules to Windows
by Tux (Canon) on Oct 01, 2018 at 14:30 UTC

    A ZERO WIDTH NO-BREAK SPACE shares the same codepoint with the BYTE ORDER MARK (U+00FEFF).

    If the BOM character appears in the middle of a data stream, Unicode says it should be interpreted as a "zero-width non-breaking space" (inhibits line-breaking between word-glyphs). In Unicode 3.2, this usage is deprecated in favor of the "Word Joiner" character, U+2060.1 This allows U+FEFF to be only used as a BOM.

    A BOM is required for UTF-16 (because of endianness UTF-16be vs UTF-16le). In UTF-8 encoded files, a BOM is optional and advised to omit.

    "The Unicode Standard 5.0, Chapter 2:General Structure" (PDF). p. 36. Retrieved 2008-11-30. Use of a BOM is neither required nor recommended for UTF-8, but may be encountered in contexts where UTF-8 data is converted from other encoding forms that use a BOM or where the BOM is used as a UTF-8 signature

    Read this very nice article. It is about perl6, but there is no code in there whatsoever, so it have easily been written in the earlier days of perl5 but with new insights.


    Enjoy, Have FUN! H.Merijn
      Thank you! I should have recognised the U+FEFF codepoint as BOM, but I relied on Perl's charnames::viacode to produce the name for me. Indeed, a BOM in the beginning of a file is much less surprising.
Re^5: Need Help Porting XS Modules to Windows
by syphilis (Archbishop) on Oct 01, 2018 at 22:57 UTC
    Programmers' text editors usually highlight such "strange" characters

    Yes, I don't use a Programmers' text editor.
    Is there a way to remove the garbage using Windows' notepad or wordpad ?
    Otherwise, I guess I can use perl to remove it.

    Cheers,
    Rob
      Notepad's "save as" "ANSI" should at least get rid of the BOM, and "save as" Unicode adds it…
        Notepad's "save as" "ANSI" should at least get rid of the BOM

        Thanks - that works fine.
        With that fixed, I then face exactly the same problems with ICC-Support-Lapack-0.6 as I reported for ICC-Support-Levmar-0.50.

        That's about as far as I've got.
        I don't trust Module::Build to do things correctly and I don't make any attempt to become familiar with it. There's also a lot I don't know about macos.
        Can the OP provide Makefile.PL files (as replacements to the Build.PL files) that work fine on his macs ?

        Cheers,
        Rob