Jump to content
  • Advertisement
Sign in to follow this  
abdellah

scan a string character one by one & hexadecimal code

This topic is 1519 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hello

i have a string in Arabic language, let's for example say : 

???

which  means MONNEY in english. In Arabic language, & i use the vb.NET , if i scan my word characterly one by one, i got this result

 

For i = 1 to len("???") step 1

dim t as string = mid("???", i , 1)

 

msgbow(t)

next i

 

i = 1   gives t = "?"

i = 2 gives t = "?"

i = 3  gives t = "?"

 

the problem is the scanning does not respect the hexadecimal code of the letter , because actualy the first character is not "?" but "?".

(the hexadecimal code is not the same, & every one of these two characters is consedred as a separated glyph)

the same thing for the letter "?", it is in reality the letter "?",

 

is there any function in .NET framework, & especialy in .NET Framework 2.0 version that gives me the correct hexadecimal?

 

(i have test the VisualBasic.AscW & VisualBasic.CHrW but they give the hexadecimal code of the wrong characters).

 

Share this post


Link to post
Share on other sites
Advertisement

The characters in the string you posted are (unicode UTF-16): 0x0645, 0x0627, 0x0644. Why would you expect the first two of them to be 0xFEE3 and 0xFE8E ?

Edited by tonemgub

Share this post


Link to post
Share on other sites

I know nothing specific about Arabic BUT

I know it is a context-dependent "complex script".

 

Thereby, it goes through a whole thing called Unicode which considers clusters of characters (I think the Unicode standard calls them "runs"). Unfortunately this means splitting the clusters into pieces might not work as expected. Besides this (which is hopefully an ELI5 version of what Bregma wrote) I'm sorry I cannot help because I'd love to learn about this.

Edited by Krohm

Share this post


Link to post
Share on other sites

ok guys, wait moment, i use UNICODE encoding with vb.NET, in some languages (i think all righ to left language)  , there some letters (not all) need to be modified if they placed with a specific letter (before or after) , so the scanning gives the general form of the character , for example (the word ??? is splitted into ? + ? + ? not into ? + ? + ?)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!