Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. WinXP strange character conversion

WinXP strange character conversion

Scheduled Pinned Locked Moved Visual Basic
helpquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    John Shaw
    wrote on last edited by
    #1

    Private Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw

    A J 2 Replies Last reply
    0
    • J John Shaw

      Private Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw

      A Offline
      A Offline
      Anonymous
      wrote on last edited by
      #2

      UTF-8 and ISO-8859-1

      1 Reply Last reply
      0
      • J John Shaw

        Private Sub box_Keypress(KeyAscii As Integer) 'if you enter ALT+0176 'then KeyAscii = 176 normaly, but on some WinXP machines 'KeyAscii = -23583 (because character not in range [0,127]). 'Also note that if you try to convert this value to a character, 'you'll get a range error (of course). End Sub Does anyone know why we receive an invalid character code on some WinXP machines and not on others? Why are only characters in the range [0,127] being properly passed to Keypress? Signed: John R. Shaw

        J Offline
        J Offline
        John Shaw
        wrote on last edited by
        #3

        Note: UNICODE uses same extended character codes as windows extended codes. The problem only happens in VB code. I think the problem only occurs on WinXP, if more than one language is installed. On Win2000; if you select Chinese (Taiwan): ALT+0176 translated to 162 = '¢'. ALT+0177 translated to 161 = 'í'. ALT+0178 translated to 50 = '2'.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups