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

Error C2001: Newline in constant when compiling Rufus #1277

Closed
kuh3h3 opened this issue Mar 10, 2019 · 5 comments
Closed

Error C2001: Newline in constant when compiling Rufus #1277

kuh3h3 opened this issue Mar 10, 2019 · 5 comments
Assignees
Milestone

Comments

@kuh3h3
Copy link

kuh3h3 commented Mar 10, 2019

I know this is known problem and is not rufus's problem.
but the error occurs always when build rufus on korean, chinese, japanese,russian locale.

yes.
it's my side(vs 2017 with windows 10( korean locale))'s problem.

i didn't want to change rufus code's encoding.

so add directly /source-charset:utf-8 to Additional Options in C/C++ Command Line
in two project( ms-sys and rufus)

now build ok (though some weird characters remain).

from MSDN

By default, Visual Studio detects a byte-order mark to determine if the source file is in an encoded Unicode format, for example, UTF-16 or UTF-8. If no byte-order mark is found, it assumes the source file is encoded using the current user code page, unless you specify a character set name or code page by using the /source-charset option.

@pbatard
Copy link
Owner

pbatard commented Mar 10, 2019

Thanks for the report.

I think I will use /utf-8 rather than /source-charset:utf-8 as it should also help with the execution charset which may be why you still get some weird characters.

At any rate one can only hope that, in future versions of Visual Studio, Microsoft will do what all other smart text processors do and properly detect UTF-8 files even when they don't have a BOM, as this isn't exactly difficult to do. In 2019, developers should really set their applications to expect UTF-8 by default, rather than obsolete local copepages...

@pbatard pbatard self-assigned this Mar 10, 2019
@pbatard pbatard changed the title Error C2001: Newline in constant Error C2001: Newline in constant when compiling Rufus Mar 10, 2019
@pbatard pbatard added this to the 3.5 milestone Mar 12, 2019
@pbatard
Copy link
Owner

pbatard commented Mar 12, 2019

Should be fixed now. Let me know if you still see an issue.

@kuh3h3
Copy link
Author

kuh3h3 commented Mar 13, 2019

thanks for quick patch.
it works well on vs 2017 .
there are no weird characters now.

but /utf8 not work on intel compiler.

from https://software.intel.com/en-us/forums/intel-c-compiler/topic/733662
improper UTF-8 characters handling by ICC on Windows

-Qoption,cpp,--unicode_source_kind,"UTF-8"

compile ok, but link failed in Release build

xilink: error #10014: problem during multi-file optimization compilation (code 1)

from https://software.intel.com/en-us/forums/intel-c-compiler/topic/361884
xilink: error #10014: problem during multi-file optimization compilation

/Qipo-

now link ok.

is this correct fix on intel compiler?

@pbatard
Copy link
Owner

pbatard commented Mar 13, 2019

is this correct fix on intel compiler?

I don't support intel compiler. Just like I don't support compilation using LLVM or anything but the Microsoft default compiler.

What you got is the best you're ever going to get from the official project. if you need more than this, then I suggest you fork your own project and apply the patches you need for your custom environment. I'm afraid I've got way too much on my plate for me to able to take on trying to support the intel compiler, sorry.

@lock
Copy link

lock bot commented Jun 11, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

@lock lock bot locked and limited conversation to collaborators Jun 11, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants