Uploaded image for project: 'C++ Standard Library'
  1. C++ Standard Library
  2. STDCXX-399

codecvt.cpp example uses uninitialized mbstate_t

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Trivial
    • Resolution: Fixed
    • 4.1.2, 4.1.3
    • 4.2.0
    • Documentation
    • None

    Description

      Quoting from http://groups.google.com/group/comp.lang.c++/tree/browse_frm/thread/85ffe366e1d65734/2276eed1d0639a15#doc_a79a047ac5f8b7a6

      On Apr 30, 4:56 am, Dancefire <Dancef...@gmail.com> wrote:
      > > Why not std::codecvt? A facet which you can obtain from a
      > > locale.
      >
      > oops, I miss the std::codecvt. Thank you.
      >
      > After I tried std::codecvt, I have 2 more questions.
      >
      > 1) Should we initialize mbstate_t variable? And how to initialize the
      > mbstate_t portable and in C++ way?
      >
      > Many sample code I saw on the net, didn't initialize the mbstate_t
      > variable. Such as:
      >
      > http://incubator.apache.org/stdcxx/doc/stdlibref/codecvt.html#sec12
      >
      > std::mbstate_t state;

      Attachments

        Activity

          People

            sebor Martin Sebor
            sebor Martin Sebor
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: