thank you for your great work.
Thanks to you.
What is missing right now
let's make a summary:
(ignoring if the data must be stored in a file, sent on telegram, sent via SMS or represented as a hexadecimal string for the PDU)
From ASCII-7bit (stored in one 8-bit byte) to any CPxxx: Not needed, already the first 128 bytes are identical on all codepages.
From ASCII-7bit (stored in one 8-bit byte) to UTF-8: Yes, just ASCIItoCP1252toUTF8
viewtopic.php?t=177551#p967513
From ASCII-7bit (stored in one 8-bit byte) to UCS-2 (and UTF-16): Yes, just ASCIItoCP1252toUNICODE, the first 128 bytes are identicals.
viewtopic.php?t=177551#p967513
From ASCII-7bit (stored in one 8-bit byte) to GSM-7: No, but simply knowing the GSM-7 alphabet
viewtopic.php?p=411358#p411358
and modifying the already existing ASCIItoCP1252toUTF8 function, it takes little, apart from renaming the function and variables appropriately, just update the internal table
From CPxxx to ASCII-7bit (stored in one 8-bit byte): Possible, but all 128 extra characters can not be coded on 128 bytes.
Can be used ASCIItoCP1252toUTF8 replacing the utf-8 table with a table where 0x00 to 0x7F are identical, but all the other are approximations of the starting character.
For example from CP1252 to ASCII-7bit: "L'offerta a ½ prezzo è €25,00" => "L'offerta a 1/2 prezzo e' EUR25,00"
From CPxxx to UTF-8: Yes, for CP1252 just use ASCIItoCP1252toUTF8
can be created any table conversion for any CP.
viewtopic.php?t=177551#p967513
From CPxxx to UCS-2 (and UTF-16): Yes, just use ASCIItoCP1252toUNICODE
also here can be created any table conversion for any CP.
viewtopic.php?t=177551#p967513
From CPxxx to GSM-7: No, but simply knowing the GSM-7 alphabet
viewtopic.php?p=411358#p411358
as before modifying the already existing ASCIItoCP1252toUTF8 function.
From UTF-8 to ASCII-7bit (stored in one 8-bit byte): Possible, like before all 65536 extra characters can not be coded on 128 bytes.
Can be used the part of UTF8toUCS2 that code first 0x7F bytes, but all ~65400 more characters????
From UTF-8 to CPxxx: Possible, but only 256 characters can be specified. But on this case, knowing the destination CP, there is no confusion on destination characters.
Probably reverting table inside ASCIItoCP1252toUTF8 function, and creating a table pairs for each codepage wanted, do the work,
but all UTF-8 characters not used from that codepage, must be represented with "?"
From UTF-8 to UCS-2: Yes, the function above
From UTF-8 to GSM-7: Possible, but is again the same thing of ASCII-7bit: can be represented only 128 (not really true, just some more than 128) and is why on SMS exist UCS-2
From UCS-2 to ASCII-7bit (stored in one 8-bit byte): Possible, like before all 65536 characters can not be coded on 128 bytes.
From UCS-2 to CPxxx: Possible, but only 256 characters can be specified. But also on this case, knowing the destination CP, there is no confusion on destination characters.
Probably reverting table inside ASCIItoCP1252toUNICODE function, and creating a table pairs for each codepage wanted, do the work,
but all UCS-2 characters not used from that codepage, must be represented with "?"
viewtopic.php?t=177551#p967513
From UCS-2 to UTF-8: Yes, again the function above
From UCS-2 to GSM-7: Possible, but is again the same thing everytime: can be represented only 128 bytes
I probably wrote something wrong with copy and paste or for sure the English syntax, but I think you understand enough.