Juggler_IN
Active Member
- Joined
- Nov 19, 2014
- Messages
- 349
- Office Version
- 2003 or older
- Platform
- Windows
In VBA "!" has the same ASC, ASCB, ASCW values ...
?ASC("!")
33
?ASCB("!")
33
?ASCW("!")
33
But € has different ASC, ASCB, ASCW values ...
?ASC("€")
128
?ASCB("€")
172
?ASCW("€")
8364
Which I understand... But the reverse functions Chr, ChrB, and ChrW do not exactly convert back the integer values.
?Chr(128)
€
?ChrW(8364)
€
?StrConv(ChrB(172), vbUnicode)
"¬"
How to get ChrB() to give, for example, € for integer 172? (Note: StrConv(ChrB(33), vbUnicode) gives correct output! So, the Issue seems to be around 2-byte characters.)
?ASC("!")
33
?ASCB("!")
33
?ASCW("!")
33
But € has different ASC, ASCB, ASCW values ...
?ASC("€")
128
?ASCB("€")
172
?ASCW("€")
8364
Which I understand... But the reverse functions Chr, ChrB, and ChrW do not exactly convert back the integer values.
?Chr(128)
€
?ChrW(8364)
€
?StrConv(ChrB(172), vbUnicode)
"¬"
How to get ChrB() to give, for example, € for integer 172? (Note: StrConv(ChrB(33), vbUnicode) gives correct output! So, the Issue seems to be around 2-byte characters.)