Re: to register instance of UNICODE string

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2009/2/25 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,

Which was in the line immediately before the text quoted above.
The gloss in my message was coming _after_ the raw data
that it referred to, rather than before.
I.e.

   04 10
           meaning a 16-octet string
   44 00 ...
           being the string itself

Sorry if that was confusing.




>  I'm guessing that wide characters (L"") on OP's platform are 32 bits.

Yes - that was my conclusion too.



>> > 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 ... never [been] a "UTF" encoding ....  The only
> one that I would expect to have any chance of success is UTF-8,

Which is what I was assuming this was.  Certainly the original MIB object has
the syntax snmpAdminString which is defined as handling UTF-8 text.


>    which is guaranteed not to be generated by L"".

Fair enough.
I said right from the start that I wasn't an expert on internationalization :-)
I happily defer to your superior knowledge.

If wide ASCII and UTF-8 are different (which a quick Google confirms),
then it looks like the error was in the original code.
     I'm quite happy with invalid input producing invalid output: :-)


Dave

------------------------------------------------------------------------------
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.