Android Question Problem on text.lenght with 2 same text

ArminKH

Well-Known Member
hi all
This is so wonderfull
i have a text file(written by notepad) with 1 simple string like "ArminKH"
by using text reader i read my string from text file but today when i log my text.lenght i see wrong result
when i copy my text from log to one line of b4a i see different font for my text but i never change any fonts
please let me to know what is wrong on this simple thing or maybe i am on sleep
please see attached sample code + screen shot + text file
 

Attachments

  • WW.zip
    11 KB · Views: 191
  • data.txt
    485 bytes · Views: 167
  • Untitled.png
    Untitled.png
    79.3 KB · Views: 186
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
Hmm strange, 2 different font types (type face). I had big issues with your first log line but your second line worked perfect. Even using the cursor to scroll along the first log line caused issues. Even when I go to Tools > IDE Options > Change Font, and I change the fonts, font style and font size I still had issues with your first log file. Writing the line out manually works perfectly fine though :confused:
 
Last edited:
Upvote 0

ArminKH

Well-Known Member
@Erel
Excuse me 4 mention u but i think this question just can be answered by u :(
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
Look at the B4a file using a Hex editor, the text you have pasted has 3 extra values (hex ef,bb and bf) which are presumably changing the displayed font, and causing the string size error.
 
Upvote 0

ArminKH

Well-Known Member
Look at the B4a file using a Hex editor, the text you have pasted has 3 extra values (hex ef,bb and bf) which are presumably changing the displayed font, and causing the string size error.
thank u
And what is the solution? Write text file just by using b4a text writer?
 
Upvote 0

stevel05

Expert
Licensed User
Longtime User
That may not always be feasible if you need to use third party text files, and it depends on the required use of the file. If you only want a plain text file you could check the Ascii range of it's content and remove unwanted characters. You could duplicate the file first if you want to keep the original intact.
 
Upvote 0
Top