Android Question if "M" = "M" but false, "µ".ToUpper => "M" <> "M" ?

Hubert Brandel

Active Member
Licensed User
Longtime User
Hi,

I had some problems with a special char ... µ
B4X:
sIRAblType = ... could get "M" or "µ" ... or others ...
Log("IRDA-Version JA - Typ:'" & sIRAblType & "' (1)")     ' shows 'M' or 'µ' (1)
sIRAblType = sIRAblType.Trim.ToUpperCase ' µ 0> M
Log("IRDA-Version JA - Typ:'" & sIRAblType & "' (2)")     ' shows 'M' !      (2)
Select sIRAblType
    Case "M", "µ"
         ... here I only see the original 'M' values
    Case Else
         ... here I see the original 'µ', but now 'M'
         Log("..." & sIRAblType & "' " & oIRDA.Text)  ' shows 'M' from µ records.  
End Select
some time ago, I found that in the same situation
B4X:
if sIRAblType = "M" or sIRAblType="µ" then 
   ' shows TRUE when it was a M record, but 
else
   ' shows FALSE after <Trim.ToUpperCase> has changed 'µ' to 'M'
endif
after I comment out this line all works correct !
' sIRAblType = sIRAblType.Trim.ToUpperCase ' µ 0> M

very strange this ...
 

Theera

Well-Known Member
Licensed User
Longtime User
Using Magret's StringFuction i.e. s.Trim() Command
 
Upvote 0

Hubert Brandel

Active Member
Licensed User
Longtime User
μ is greek letter, its upper case is not the latin M, but the greek Μ. Looks the same, yet their code is not.
Of course ... I thought in ANSI basic terms ... in my Windows compilers upper("µ") or ucase$("µ") will not be changed, so I was confused.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…