1
0
mirror of https://github.com/ppy/osu.git synced 2026-05-25 03:09:54 +08:00

Merge pull request #31433 from bdach/romanised-metadata-ascii-only

Constrain range of usable characters in romanised metadata to ASCII only
This commit is contained in:
Dean Herbert
2025-01-07 03:29:44 +09:00
committed by GitHub
Unverified
+1 -1
View File
@@ -15,7 +15,7 @@ namespace osu.Game.Beatmaps
/// Returns <see langword="true"/> if the character <paramref name="c"/> can be used in <see cref="BeatmapMetadata.Artist"/> and <see cref="BeatmapMetadata.Title"/> fields.
/// Characters not matched by this method can be placed in <see cref="BeatmapMetadata.ArtistUnicode"/> and <see cref="BeatmapMetadata.TitleUnicode"/>.
/// </summary>
public static bool IsRomanised(char c) => c <= 0xFF;
public static bool IsRomanised(char c) => char.IsAscii(c) && !char.IsControl(c);
/// <summary>
/// Returns <see langword="true"/> if the string <paramref name="str"/> can be used in <see cref="BeatmapMetadata.Artist"/> and <see cref="BeatmapMetadata.Title"/> fields.