Search Issue Tracker
By Design
Votes
0
Found in
5.3.3p1
Issue ID
791466
Regression
No
WebGL build System.StringComparison.OrdinalIgnoreCase is case sensitive
Steps to reproduce:
1. Open "case_791466- repro" project
2. Open "Test" scene
3. "Build and run" WebGl build
4. Open javaScript console (Chrome ctrl+Shift+J) and notice line "s1 matches"
Note:If you run in editor, console prints that "s1 matches" and "s2 matches" and that means that System.StringComparison.OrdinalIgnoreCase works correctly.
Expected: In both WebGl build and editor, System.StringComparison.OrdinalIgnoreCase ignores case.
Actual: In WebGl build System.StringComparison.OrdinalIgnoreCase is case sensitive.
Reproduced on: Unity 5.4.0b16; 5.4.0b15; 5.3.4p4; 5.3.3p1; 5.2.4f1
Comments (9)
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- UXML elements visually stretch when dragging an element along other elements in the UI Builder Hierarchy
- Material does not update when setting an enum keyword using EnableKeyword
- AddComponentMenu.componentOrder has no effect on the "Add Component" menu in the Inspector window
- Distant objects become visibly illuminated when looking through the volumetric fog with SSGI enabled
- WebGL build crashes when opening a ZipArchive entry and "Code Optimization" is not set to the default "Shorter Build Time"
neilx
Oct 29, 2021 18:27
like seriously unity, at least throw a NotSupportedException.
neilx
Oct 29, 2021 18:26
this is still hitting us on 2019 LTS. This can not be considered By Design because the expected result of a case-insensitive string compare is very well defined. The main reason to use the string comparison stuff is so we can compare strings without creating new ones.. We need this to filter search results and do binary searches, and using ToLower() on both sides of the string kills performance when you have thousands and thousands of strings to compare.
MatchaJoeJoe
Nov 14, 2020 18:56
I just found this in a project I've been working and it is ridiculous that this is considered "BY DESIGN", you're better than this unity devs, cmon.
If anyone is looking for a work-around, I ended up using .ToLower() on both strings to get around this, but it's dumb that I needed to do this.
friuns3
Jul 10, 2020 11:05
wtf lol, unity devs can't be so lazy
HenrikLSP_IL
Mar 19, 2018 14:52
I have this issue as well. It took me several hours to figure out that a bug happens because StringComparison IgnoreCase does not ignore case on WebGL. Very annoying...
"By Design"??? That simply cannot be correct. Please don't tell us that some designer explicitly wrote a requirement stating that "IgnoreCase must do the exact opposite of what its name suggest, but only for WebGL".
Is there some way to have this issue reopened?
Noel9386
Mar 15, 2018 14:49
"Status: By Design" means it was meant to function that way, which really sucks.
Knusper
Feb 14, 2018 18:21
As I currently needed this function in WebGL I can confirm you that "By Design" means they didn't do anything... without any comment or any hint for WebGL deploys. It took so much time to find out what was going on in our game. We wanted to do a string comparison using StartsWith and EndsWith.
We also used SYSTEM.STRINGCOMPARISON.ORDINALIGNORECASE. What was the result? Our if statements all went false an we needed to make build after build to find out (via logs) what the problem was.
mabakay
Jun 22, 2016 09:06
What does mean "Status: By Design"? Will it be fixed or not? If not maybe some warning in editor console?