How to Check a String Charset

sktanmoy

Active Member
Licensed User
Longtime User
I need to check if the string is English (I mean if the characters/latter are English). How can I do that?
 

Theera

Expert
Licensed User
Longtime User
I need to check if the string is English (I mean if the characters/latter are English). How can I do that?

Hi sktanmoy,
I have ever check Thai characters,please see post #15. I think that it 's alike mine.
 
Upvote 0

sktanmoy

Active Member
Licensed User
Longtime User
Thanks

Thanks, I was working with two languages (Bengali and English). As I had no idea how to detect Bengali, so wanted to detect English.


B4X:
Sub IsThai (s As  String ) As  Boolean 
    For I = 0 To S.Length - 1
         Dim codepoint As Int = Asc (S.CharAt (I))
         If codepoint >= 0x0E00 AND codepoint <= 0x0E7F Then Return True
    Next 
    Return False
End  Sub

No what I've understood, using codepoint >= 0x0E00 AND codepoint <= 0x0E7F, you've detected Thai. Can you please help me to find out those for other language?

My Language, black from U+0980 to U+09FF.
 
Last edited:
Upvote 0

sktanmoy

Active Member
Licensed User
Longtime User
Wow

WOW, codepoint >= 0x0980 AND codepoint <= 0x09FF Then Return True worked for me, thanks a lot friend.
 
Upvote 0
Top