B4R Tutorial Strings and Bytes - Erel    Nov 26, 2017   (7 reactions) B4R strings are different than in other B4X tools. The reasons for these differences are:
1. Very limited memory.
2. Lack of Unicode encoders.
A String object in B4R is the same as C char* string. It is an array of bytes with an additional zero byte at the end.
The requirement of the last zero byte B4A Question java.net.IDN. [Solved] - Erel (first post)    Feb 07, 2021   (1 reaction) A bit.
You can convert strings to bytes with any encoding you like and then back to a string. Once it is a String object, it doesn't have any encoding. B4J Question String to bytes handling with encryption - Erel (first post)    Jul 04, 2022   (2 reactions) #AdditionalJar: bcprov-jdk15on-154
Sub Process_Globals
End Sub
Sub AppStart (Args() As String)
Dim p As String = "123456"
Dim s As String = "top secret"
Dim enc As String = Encrypt(s, p)
Log(enc)
Dim dec As String = Decrypt(enc, p)
Log(dec)
End Sub
Private Sub Encrypt B4A Code Snippet [B4X] Bytes To File - Erel    May 24, 2020   (19 reactions) This code is no longer needed. Use File.WriteBytes / ReadBytes.
Write an array of bytes to a file and read a file into an array of bytes.
Sub BytesToFile (Dir As String, FileName As String, Data() As Byte)
Dim out As OutputStream = File.OpenOutput(Dir, FileName, False)
out.WriteBytes(Data, B4J Question AStream_NewData (Buffer() As Byte) Fill Buffer with data - Erel (first post)    Aug 08, 2019   (1 reaction) You shouldn't convert bytes to string unless the bytes actually represent string. The correct solution should be based on B4XBytesBuilder from B4XCollections library. B4A Tutorial [B4X] Text, Strings and Parsers - Erel    May 19, 2020   (20 reactions) CSVParser (B4X) - B4X class that reads and writes CSV files. It can handle non-UTF8 encoding and can be customized to better handle errors. Base64 encoding It is a common mistake to treat raw bytes as strings. It doesn't work. If you want to convert raw bytes to a string then you need to use the B B4R Question Bytes to String - Erel (first post)    Jun 25, 2017   (2 reactions) The bytes do not represent a string. Maybe the baudrate is incorrect.
You don't need to do anything special to convert bytes to string. B4A Question string to bytes for jmqtt - Erel (first post)    Mar 14, 2017 B4XSerializator is only relevant if both sides use it.
client.Publish2("hello", "CLIC".GetBytes("utf8"), 0, False)
Use BytesToString keyword to convert an array of bytes to string. B4A Question Send hex bytes to TCP - Erel (first post)    Mar 18, 2024 It depends on what you are trying to send. If you want to send the string then call GetBytes to convert it to bytes. If the string itself is in hex format then use ByteConverter.HexToBytes (or BytesFromHex) to convert it to an array of bytes. B4A Question How can I encrypt a String in a text file? - Erel (first post)    May 07, 2020   (2 reactions) Base 64 is the correct way to convert "random bytes" to string. Another simple option is to use KVS (2) which supports encryption as well, though it will not create a text file (why does it matter?). Page: 1   2   3   4   5   6   7   Powered by ColBERT |