Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • L linux
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • linux
  • Repository
  • linux
  • lib
  • ucs2_string.c
Find file BlameHistoryPermalink
  • Jason Andryuk's avatar
    lib/ucs2_string: Correct ucs2 -> utf8 conversion · e90f4779
    Jason Andryuk authored Feb 12, 2016
    commit a6807590
    
     upstream.
    
    The comparisons should be >= since 0x800 and 0x80 require an additional bit
    to store.
    
    For the 3 byte case, the existing shift would drop off 2 more bits than
    intended.
    
    For the 2 byte case, there should be 5 bits bits in byte 1, and 6 bits in
    byte 2.
    
    Signed-off-by: default avatarJason Andryuk <jandryuk@gmail.com>
    Reviewed-by: default avatarLaszlo Ersek <lersek@redhat.com>
    Cc: Peter Jones <pjones@redhat.com>
    Cc: Matthew Garrett <mjg59@coreos.com>
    Cc: "Lee, Chun-Yi" <jlee@suse.com>
    Signed-off-by: default avatarMatt Fleming <matt@codeblueprint.co.uk>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    e90f4779
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7