TWAIN Working Group

Newsletter Signup
Donate
Help keep TWAIN free
  • About TWAIN
    • What’s New?
    • News
    • Events
    • Membership
    • Consider a Donation
    • Contact Us
  • Why TWAIN?
  • Developers
    • Driver Developer
    • Application Developer
    • TWAIN Features
    • Specification & Tools
    • Self Certification Process
  • Support Forums
  • Scanner End-User
  • Find Certified Drivers
    • Facebook
    • LinkedIn
    • Vimeo

Bug in twain.h definitions of TWCY_… codes

Forums › TWAIN Classic › Bug in twain.h definitions of TWCY_… codes

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 8 months ago by MarkM.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • April 24, 2013 at 7:19 am #22840 Reply
    pullmoll
    Participant
    • Topics - 1
    • Replies - 1
    • Total Posts - 2

    When writing yet another piece of interface code to TWAIN, I stumbled across a (long standing?) bug in twain.h
    The country code for Andorra is defined as
    #define TWCY_ANDORRA 033
    and later the country code for South Africa is defined as
    #define TWCY_SOUTHAFRICA 27

    Now you should be aware of the fact that 033 is octal notation because of the leading zero and thus there is a value clash between Andorra and South Africa. This may not yet have caused issues, because probably few TWAIN drivers come with country codes of Andorra and South Africa. It is, however, an issue for applications that wish to translate codes into names and vice-versa.

    To correct the issue the line for Andorra should become
    #define TWCY_ANDORRA 33
    which makes it equal to the country code for France, which probably is what was intended.
    There are a few more numbers with leading zeroes which don’t cause issues just for the fact that they are below 010 and thus the notation is the same in both base 10 and base 8. They should all be stripped of leading zeroes.

    Regards,
    Jürgen

    April 30, 2013 at 7:20 pm #25871 Reply
    MarkM
    Participant
    • Topics - 1
    • Replies - 135
    • Total Posts - 136

    Thanks for the catch! We’ll be getting that into the Spec…

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Bug in twain.h definitions of TWCY_… codes
Your information:




Quick Links

Service Providers
TWAIN Support Forums
Membership
Contact Us
Privacy Policy

Newsletter Signup

TWAIN Working Group Family

TWAIN Working Group
TWAIN Direct®
TWAIN Resources
TWAIN Certified Drivers
PDF/raster

  • Facebook
  • GitHub
  • LinkedIn
  • Vimeo

Recent Topics

  • Hello world
  • Girls of Desire: All babes in one place, crazy, art
  • EPSON V600 TWAIN and WIA on Windows 10
  • When and how to use WaitForEvents command ?
  • Problem enumerating list of installed scanners in windows server 2012
  • Quarterly Newsletter
  • TWAIN Working Group Membership
  • Logo Usage
  • TWAIN License
  • Contact Us
Privacy Policy • Privacy Tools • Copyright © 2021 TWAIN Working Group • by iHwy, LLC • Log in

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.