tinymux/mux/lua54/lua54.vcxproj
Stephen Dennis ee66b0083a build(win32): add /utf-8 to the MSVC projects (#1499)
Step 1 of #1499, the behaviour-neutral half.  Adds /utf-8 to all eleven
vcxproj files and to the two MSVC builder scripts, so source and
execution charset are both UTF-8 instead of the system code page.

Verified neutral rather than asserted.  Built the tree twice on the same
box, with and without the flag, and diffed the extracted string tables:

    netmux.exe   1 differing line
    engine.dll   1 differing line
    libmux.dll   0 differing lines

Every one of those is binary noise at a shifted address that happens to
match a UTF-8 lead-byte pattern; the only human-readable difference in
the whole comparison is engine.dll's __DATE__/__TIME__ stamp.  No string
literal changes, and the U+2019 counts are identical (netmux 5,
engine 175, libmux 1), as are the file sizes.

Also measured why the escapes exist, because it is not what I expected.
On this box the active code page is 1252, and raw UTF-8 in a narrow
literal survives WITHOUT the flag -- all six typographic characters from
the issue's table round-trip byte-for-byte, including U+201D, whose 0x9D
is undefined in CP1252.  So "it works here" would have been a misleading
result to report.

The flag matters on a DBCS locale.  Compiling the same file as a
Japanese-locale box would:

    cl /source-charset:.932 /execution-charset:.932
    warning C4819: The file contains a character that cannot be
                   represented in the current code page (932)
    error C2001: newline in string literal

It does not mangle quietly -- it fails to compile, because the UTF-8
bytes are read as Shift-JIS lead bytes and swallow the closing quote.
With /utf-8 on that same simulated locale, correct.  That is the real
constraint the hex escapes were working around, and this removes it.

Step 2 (converting escapes to characters) is deliberately not here.  It
should follow only once this is in and verified, exactly as the issue
sequences it.

Smoke: 316 dispatched, 1487 succeeded, 17 failed -- the known
build-configuration failures on this box.  format, netaddr and alarm
harnesses all pass.  No C4819 anywhere in the build.

Two vcxproj files (sqlproxy, sqlslave) carry a UTF-8 BOM; my first pass
stripped it and I put it back, so the diff is 22 insertions and no
deletions.

tests/dbt/build-msvc.sh needs the same flag and is not in this commit --
it is still in review as #1493.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-26 20:58:42 -06:00

118 lines
5.3 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{C4D5E6F7-A8B9-0123-CDEF-456789ABCDEF}</ProjectGuid>
<RootNamespace>lua54</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v145</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v145</PlatformToolset>
<UseOfMfc>false</UseOfMfc>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<OutDir>..\bin_release\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<OutDir>..\bin_debug\</OutDir>
<IntDir>$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<Optimization>Full</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
<FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
<PreprocessorDefinitions>WIN32;NDEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader />
<CompileAs>CompileAsC</CompileAs>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4244;4702;4334</DisableSpecificWarnings>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)lua54.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<AdditionalOptions>/utf-8 %(AdditionalOptions)</AdditionalOptions>
<Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_DEBUG;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<PrecompiledHeader />
<CompileAs>CompileAsC</CompileAs>
<WarningLevel>Level3</WarningLevel>
<DisableSpecificWarnings>4244;4702;4334</DisableSpecificWarnings>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Lib>
<OutputFile>$(OutDir)lua54.lib</OutputFile>
</Lib>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="lapi.c" />
<ClCompile Include="lauxlib.c" />
<ClCompile Include="lbaselib.c" />
<ClCompile Include="lcode.c" />
<ClCompile Include="lcorolib.c" />
<ClCompile Include="lctype.c" />
<ClCompile Include="ldblib.c" />
<ClCompile Include="ldebug.c" />
<ClCompile Include="ldo.c" />
<ClCompile Include="ldump.c" />
<ClCompile Include="lfunc.c" />
<ClCompile Include="lgc.c" />
<ClCompile Include="linit.c" />
<ClCompile Include="liolib.c" />
<ClCompile Include="llex.c" />
<ClCompile Include="lmathlib.c" />
<ClCompile Include="lmem.c" />
<ClCompile Include="loadlib.c" />
<ClCompile Include="lobject.c" />
<ClCompile Include="lopcodes.c" />
<ClCompile Include="loslib.c" />
<ClCompile Include="lparser.c" />
<ClCompile Include="lstate.c" />
<ClCompile Include="lstring.c" />
<ClCompile Include="lstrlib.c" />
<ClCompile Include="ltable.c" />
<ClCompile Include="ltablib.c" />
<ClCompile Include="ltm.c" />
<ClCompile Include="lundump.c" />
<ClCompile Include="lutf8lib.c" />
<ClCompile Include="lvm.c" />
<ClCompile Include="lzio.c" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>