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

Use ASCII strings in source files #78265

Merged
merged 1 commit into from
Nov 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion THIRD-PARTY-NOTICES.TXT
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ License for fastmod (https://github.com/lemire/fastmod) and ibm-fpgen (https://g
License for sse4-strstr (https://github.com/WojciechMula/sse4-strstr)
--------------------------------------

Copyright (c) 2008-2016, Wojciech Muła
Copyright (c) 2008-2016, Wojciech Mula
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/nativeaot/docs/optimizing.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ under the `<Project>` node of your project file.

The Native AOT compiler supports the [documented options](https://docs.microsoft.com/en-us/dotnet/core/deploying/trim-self-contained) for removing unused code (trimming). By default, the compiler tries to very conservatively remove some of the unused code.

🛈 Native AOT difference: The documented `PublishTrimmed` property is implied to be `true` when Native AOT is active.
:information_source: Native AOT difference: The documented `PublishTrimmed` property is implied to be `true` when Native AOT is active.

By default, the compiler tries to maximize compatibility with existing .NET code at the expense of compilation speed and size of the output executable. This allows people to use their existing code that worked well in a fully dynamic mode without hitting issues caused by trimming. To read more about reflection, see the [Reflection in AOT mode](reflection-in-aot-mode.md) document.

Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/GCLogParser/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("parse-hb-log")]
[assembly: AssemblyCopyright("Copyright © 2019")]
[assembly: AssemblyCopyright("Copyright \u00A9 2019")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand Down
16 changes: 8 additions & 8 deletions src/coreclr/tools/GCLogParser/parse-hb-log.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,19 @@
// pass-zero-pass1-nX-ia1-thread.txt
//
// thread tells you the thread index running on each proc at each timestamp.
// 4240| 63 | 65 | 62 | 56₁₀| 87₁₀|109₁₀| 59 | 70₁₀| 78 | 64 | 71₁₀|107₁₀|
// 4240| 63\u2089 | 65\u2089 | 62\u2089 | 56\u2081\u2080| 87\u2081\u2080|109\u2081\u2080| 59\u2089 | 70\u2081\u2080| 78\u2089 | 64\u2089 | 71\u2081\u2080|107\u2081\u2080|
//
// 4240 is the 4240th ms since we started recording.
// the numbers following are the thread indices and the subscript is the # of samples
// observed during that ms. The tool can do a time unit that's larger than 1ms.
//
// alloc tells you which alloc heap the each proc, for the same timestamp
// 4240| 56 | 57 | 58ⁱ | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
// 4240| 56 | 57 | 58\u2071 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
// 56 means heap 56. The subscript i means we did a SetIdealProcessor during this
// ms. You may also see
// meaning we went through the balancing logic due to the proc for the thread changed
// \u1D56 meaning we went through the balancing logic due to the proc for the thread changed
// from the home heap.
// meaning while we were going through balancing logic the proc switched.
// \u1D50 meaning while we were going through balancing logic the proc switched.

using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -637,15 +637,15 @@ static string FormatFlags(int flags)
string strFormattedFlags = "";
if ((flags & (int)HeapBalanceFlagMask.MutipleProcs) != 0)
{
strFormattedFlags += "";
strFormattedFlags += "\u1D50";
}
if ((flags & (int)HeapBalanceFlagMask.EnterDueToProc) != 0)
{
strFormattedFlags += "";
strFormattedFlags += "\u1D56";
}
if ((flags & (int)HeapBalanceFlagMask.SetIdeal) != 0)
{
strFormattedFlags += "";
strFormattedFlags += "\u2071";
}

return strFormattedFlags;
Expand Down Expand Up @@ -696,7 +696,7 @@ static void PrintProcActivityOnNode()

// see https://en.wikipedia.org/wiki/Unicode_subscripts_and_superscripts
// for subscript characters
// ᵐ,ᵖ,ⁱ
// \u1D50,\u1D56,\u2071
if (fPrint)
{
int procsHadSamples = 0;
Expand Down
6 changes: 3 additions & 3 deletions src/coreclr/tools/aot/Mono.Linker.Tests/Extensions/NiceIO.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
// The MIT License(MIT)
// =====================
//
// Copyright © `2015-2017` `Lucas Meijer`
// Copyright \u00A9 `2015-2017` `Lucas Meijer`
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the Software), to deal in the Software without
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
Expand All @@ -18,7 +18,7 @@
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED AS IS, WITHOUT WARRANTY OF ANY KIND,
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
Expand Down
2 changes: 1 addition & 1 deletion src/coreclr/tools/dotnet-pgo/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ private static void PrintCallsitesByLikelyClassesChart(int[] callSites)
int shareWidth = (int)(Math.Round(share * tableWidth));
bool lastRow = (i == rows.Length - 1);

Console.Write($" {(lastRow ? "" : " ")}{i,2}: [");
Console.Write($" {(lastRow ? "\u2265" : " ")}{i,2}: [");
Console.Write(new string('#', shareWidth));
Console.Write(new string('.', tableWidth - shareWidth));
Console.Write("] ");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void Bundled_Localized_App_Run_Succeeds()
.Should()
.Pass()
.And
.HaveStdOutContaining("ನಮಸ್ಕಾರ! வணக்கம்! Hello!");
.HaveStdOutContaining("\u0CA8\u0CAE\u0CB8\u0CCD\u0C95\u0CBE\u0CB0! \u0BB5\u0BA3\u0B95\u0BCD\u0B95\u0BAE\u0BCD! Hello!");
}

public class SharedTestState : SharedTestStateBase, IDisposable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ public void Put_satellite_assembly_behind_symlink()
.CaptureStdOut()
.Execute()
.Should().Pass()
.And.HaveStdOutContaining("ನಮಸ್ಕಾರ! வணக்கம்! Hello!");
.And.HaveStdOutContaining("\u0CA8\u0CAE\u0CB8\u0CCD\u0C95\u0CBE\u0CB0! \u0BB5\u0BA3\u0B95\u0BCD\u0B95\u0BAE\u0BCD! Hello!");
}

public class SharedTestState : IDisposable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,8 @@ public void CantAcceptDuplicateKeysFromSourceDictionary()
// https://github.com/dotnet/runtime/issues/44681
public void DictionaryOrdinalIgnoreCaseCyrillicKeys()
{
const string Lower = "абвгдеёжзийклмнопрстуфхцчшщьыъэюя";
const string Higher = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯ";
const string Lower = "\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044C\u044B\u044A\u044D\u044E\u044F";
const string Higher = "\u0410\u0411\u0412\u0413\u0414\u0415\u0401\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042C\u042B\u042A\u042D\u042E\u042F";

var dictionary = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ private static void ValidateBehaviorOfInternalComparerVsPublicComparer(IEquality
("Hello", "hello"), // case-insensitive equal
("Hello", "He\u200dllo"), // equal under linguistic comparer
("Hello", "HE\u200dLLO"), // equal under case-insensitive linguistic comparer
("абвгдеёжзийклмнопрстуфхцчшщьыъэюя", "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЬЫЪЭЮЯ"), // Cyrillic, case-insensitive equal
("\u0430\u0431\u0432\u0433\u0434\u0435\u0451\u0436\u0437\u0438\u0439\u043A\u043B\u043C\u043D\u043E\u043F\u0440\u0441\u0442\u0443\u0444\u0445\u0446\u0447\u0448\u0449\u044C\u044B\u044A\u044D\u044E\u044F", "\u0410\u0411\u0412\u0413\u0414\u0415\u0401\u0416\u0417\u0418\u0419\u041A\u041B\u041C\u041D\u041E\u041F\u0420\u0421\u0422\u0423\u0424\u0425\u0426\u0427\u0428\u0429\u042C\u042B\u042A\u042D\u042E\u042F"), // Cyrillic, case-insensitive equal
})
{
bool arePairElementsExpectedEqual = publicComparer.Equals(pair.Item1, pair.Item2);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System.Configuration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// The .NET Foundation licenses this file to you under the MIT license.
//
// Authors:
// Jordi Mas i Hern�ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2004 Ximian, Inc. http://www.ximian.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//
// Author:
//
// Jordi Mas i Hernandez, jordimash@gmail.com
// Jordi Mas i Hernandez (jordi@ximian.com)
//

using Xunit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
//
// Author:
//
// Jordi Mas i Hernandez, jordimash@gmail.com
// Jordi Mas i Hernandez (jordi@ximian.com)
//

using Xunit;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// BMPCodec class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2004 Ximian, Inc. http://www.ximian.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// GIF Codec class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// ICO Codec class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2006-2007 Novell, Inc (http://www.novell.com)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// JpegCodec class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// (C) 2004 Ximian, Inc. http://www.ximian.com
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// PNG Codec class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// TIFF Codec class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jordi@ximian.com)
// Jordi Mas i Hernandez (jordi@ximian.com)
// Sebastien Pouliot <sebastien@ximian.com>
//
// Copyright (C) 2006, 2007 Novell, Inc (http://www.novell.com)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// Bitmap class testing unit
//
// Authors:
// Jordi Mas i Hern?ndez (jmas@softcatala.org>
// Jordi Mas i Hernandez (jordi@ximian.com)
// Jonathan Gilbert <logic@deltaq.org>
// Sebastien Pouliot <sebastien@ximian.com>
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ protected async Task Read_Archive_Folder_File_Utf8_Async_Internal(TarEntryFormat

TarEntry directory = await reader.GetNextEntryAsync();

VerifyDirectoryEntry(directory, format, "f\u00f6ld\u00ebr/"); //földër
VerifyDirectoryEntry(directory, format, "f\u00f6ld\u00ebr/");

TarEntry file = await reader.GetNextEntryAsync();
VerifyRegularFileEntry(file, format, "f\u00f6ld\u00ebr/\u00e1\u00f6\u00f1.txt", $"Hello {testCaseName}"); // földër/áöñ.txt
VerifyRegularFileEntry(file, format, "f\u00f6ld\u00ebr/\u00e1\u00f6\u00f1.txt", $"Hello {testCaseName}");

Assert.Null(await reader.GetNextEntryAsync());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ protected void Read_Archive_Folder_File_Utf8_Internal(TarEntryFormat format, Tes

TarEntry directory = reader.GetNextEntry();

VerifyDirectoryEntry(directory, format, "f\u00f6ld\u00ebr/"); //földër
VerifyDirectoryEntry(directory, format, "f\u00f6ld\u00ebr/");

TarEntry file = reader.GetNextEntry();
VerifyRegularFileEntry(file, format, "f\u00f6ld\u00ebr/\u00e1\u00f6\u00f1.txt", $"Hello {testCaseName}"); // földër/áöñ.txt
VerifyRegularFileEntry(file, format, "f\u00f6ld\u00ebr/\u00e1\u00f6\u00f1.txt", $"Hello {testCaseName}");

Assert.Null(reader.GetNextEntry());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public void Compare_Invalid()
[Fact]
public void TestIgnoreKanaAndWidthCases()
{
for (char c = '\uFF41'; c <= '\uFF5A'; c++) // Full width 'a' to `z`
for (char c = '\uFF41'; c <= '\uFF5A'; c++)
{
Assert.False(string.Equals(new string(c, 1), new string((char) (c - 0x20), 1), StringComparison.InvariantCulture), $"Expected '{(int)c:x4}' != '{c - 0x20:x4}'");
Assert.True(string.Equals(new string(c, 1), new string((char) (c - 0x20), 1), StringComparison.InvariantCultureIgnoreCase), $"Expected '{(int)c:x4}' == '{c - 0x20:x4}'");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,8 @@ public static IEnumerable<object[]> LastIndexOf_TestData()
yield return new object[] { s_invariantCompare, "hello", "\u200d", 4, 5, CompareOptions.IgnoreCase, 5, 0};
yield return new object[] { s_invariantCompare, "hello", "\0", 4, 5, CompareOptions.None, useNls ? -1 : 5, 0};

yield return new object[] { s_invariantCompare, "A\u0303", "\u200d", 1, 2, CompareOptions.None, 2, 0}; // A + ̃ = Ã
yield return new object[] { s_invariantCompare, "A\u0303\u200D", "\u200d", 2, 3, CompareOptions.None, 3, 0}; // A + ̃ = Ã
yield return new object[] { s_invariantCompare, "A\u0303", "\u200d", 1, 2, CompareOptions.None, 2, 0};
yield return new object[] { s_invariantCompare, "A\u0303\u200D", "\u200d", 2, 3, CompareOptions.None, 3, 0};
yield return new object[] { s_invariantCompare, "\u0001F601", "\u200d", 1, 2, CompareOptions.None, 2, 0}; // \u0001F601 is GRINNING FACE WITH SMILING EYES surrogate character
yield return new object[] { s_invariantCompare, "AA\u200DA", "\u200d", 3, 4, CompareOptions.None, 4, 0};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class CultureInfoNames
[InlineData("en", "fr", "English", "anglais")]
[InlineData("aa", "aa", "Afar", "Afar")]
[InlineData("en-US", "en-US", "English (United States)", "English (United States)")]
[InlineData("en-US", "fr-FR", "English (United States)", "anglais (États-Unis)")]
[InlineData("en-US", "fr-FR", "English (United States)", "anglais (\u00C9tats-Unis)")]
[InlineData("en-US", "de-DE", "English (United States)", "Englisch (Vereinigte Staaten)")]
[InlineData("aa-ER", "aa-ER", "Afar (Eritrea)", "Afar (Eritrea)")]
[InlineData("", "en-US", "Invariant Language (Invariant Country)", "Invariant Language (Invariant Country)")]
Expand All @@ -41,7 +41,7 @@ public void TestDisplayNameWithSettingUICultureMultipleTime()
CultureInfo ci = new CultureInfo("en-US");
Assert.Equal("English (United States)", ci.DisplayName);
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("fr-FR");
Assert.Equal("anglais (États-Unis)", ci.DisplayName);
Assert.Equal("anglais (\u00C9tats-Unis)", ci.DisplayName);
CultureInfo.CurrentUICulture = CultureInfo.GetCultureInfo("de-DE");
Assert.Equal("Englisch (Vereinigte Staaten)", ci.DisplayName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,10 @@ public void ReplacementCharHasTypeOther()
continue;
}

// Line has format "÷ (XXXX (× YYYY)* ÷)+ # <comment>"
// Line has format "\u00F7 (XXXX (\u00D7 YYYY)* \u00F7)+ # <comment>"
// We'll yield return a Rune[][], representing a collection of clusters, where each cluster contains a collection of Runes.
//
// Example: "÷ AAAA ÷ BBBB × CCCC × DDDD ÷ EEEE × FFFF ÷ # <comment>"
// Example: "\u00F7 AAAA \u00F7 BBBB \u00D7 CCCC \u00D7 DDDD \u00F7 EEEE \u00D7 FFFF \u00F7 # <comment>"
// -> [ [ AAAA ], [ BBBB, CCCC, DDDD ], [ EEEE, FFFF ] ]
//
// We also return the line for ease of debugging any test failures.
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Linq/tests/OrderByTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ public void TakeOne(IEnumerable<int> source)
[Fact]
public void CultureOrderBy()
{
string[] source = new[] { "Apple0", "�ble0", "Apple1", "�ble1", "Apple2", "�ble2" };
string[] source = new[] { "Apple0", "\uFFFDble0", "Apple1", "\uFFFDble1", "Apple2", "\uFFFDble2" };

CultureInfo dk = new CultureInfo("da-DK");
CultureInfo au = new CultureInfo("en-AU");
Expand Down Expand Up @@ -583,7 +583,7 @@ public void CultureOrderBy()
[Fact]
public void CultureOrderByElementAt()
{
string[] source = new[] { "Apple0", "�ble0", "Apple1", "�ble1", "Apple2", "�ble2" };
string[] source = new[] { "Apple0", "\uFFFDble0", "Apple1", "\uFFFDble1", "Apple2", "\uFFFDble2" };

CultureInfo dk = new CultureInfo("da-DK");
CultureInfo au = new CultureInfo("en-AU");
Expand Down
4 changes: 2 additions & 2 deletions src/libraries/System.Linq/tests/OrderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ public void TakeOne(IEnumerable<int> source)
[Fact]
public void CultureOrder()
{
string[] source = new[] { "Apple0", "Æble0", "Apple1", "Æble1", "Apple2", "Æble2" };
string[] source = new[] { "Apple0", "\u00C6ble0", "Apple1", "\u00C6ble1", "Apple2", "\u00C6ble2" };

CultureInfo dk = new CultureInfo("da-DK");
CultureInfo au = new CultureInfo("en-AU");
Expand Down Expand Up @@ -454,7 +454,7 @@ public void CultureOrder()
[Fact]
public void CultureOrderElementAt()
{
string[] source = new[] { "Apple0", "Æble0", "Apple1", "Æble1", "Apple2", "Æble2" };
string[] source = new[] { "Apple0", "\u00C6ble0", "Apple1", "\u00C6ble1", "Apple2", "\u00C6ble2" };

CultureInfo dk = new CultureInfo("da-DK");
CultureInfo au = new CultureInfo("en-AU");
Expand Down
Loading