Thank you for clarification.

2009/2/26 Mike Ayers <[email protected]>

> > From: Dave Shield [mailto:[email protected]]
> > Sent: Tuesday, February 24, 2009 6:14 AM
>
> > Followed by a string value (16 octets)
> >
> > >               44 00 00 00 45 00 00 00 46 00 00 00 00 00
> > ..D...E...F.....
> > > 0064: 00 00 ..
> >
> > containing the DEF string, followed by a '\0' trailing wide-character.
>
>         That's overtrimmed.  The original read:
>
> 0048: 04 10 44 00 00 00 45 00 00 00 46 00 00 00 00 00 ..D...E...F.....
> 0064: 00 00 ..
>
>        That's 04 for octet string, 10 for 16 bytes long, and the sequences
> "44 00 00 00", "45 00 00 00", "46 00 00 00", and "00 00 00 00".  I'm
> guessing that wide characters (L"") on OP's platform are 32 bits.
>
> > > NET-SNMP-TUTORIAL-MIB::nstAgentSubagentObject.0 = STRING: D
> >
> > So yes - it's the output routines that are going wrong.
>
>         Nope.  That's the expected output when you try to print wide ASCII.
>  The second character (as interpreted by the print routine) is the null
> terminator (because it's supposed to be padding to fit the ASCII into 16 or
> 32 bits).
>
>        Note that there has not been a "Unicode" character encoding in about
> 15 years, and never a "UTF" encoding - there are UTF-16, UTF-8, UTF-32,
> UTF-16BE, UTF-16LE, etc., etc., ad nauseum.  The only one that I would
> expect to have any chance of success is UTF-8, which is guaranteed not to be
> generated by L"".  In any case, your debug output showa that your wide chars
> are transferred correctly, which *is* expected of SNMP (the joys of TLV!).
>
>        If you really need to understand this better, here's your (WARNING:
> PAINFUL!) starting point:
>
> http://www.unicode.org/reports/tr17/
>
>
>
>        Peace, love, and Unicode!
>
> Mike
>



-- 
/BR, Alexander
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to