Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Wcstombs – String Conversion

Integrated Application Platform › Forums › General › Wcstombs – String Conversion

  • This topic has 1 reply, 2 voices, and was last updated 7 years, 9 months ago by amckinlay.
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • June 2, 2015 at 10:44 am #1186
    jstapley
    Participant

    I’m trying to convert a USC-2 (UTF16) to UTF8 using the built in method Wcstombs

    Example

    temp = “”
    temp = “Test”.Wcstombs()
    Print(temp)

    Result is an Exception

    ..\gcstring.cpp:224: assertion failure: cc->left.size() + cc->right.size() == -n

    Any ideas?

    June 2, 2015 at 2:19 pm #1187
    amckinlay
    Keymaster

    I’m not sure why Wcstombs() is causing problems (I got an access violation when I tried your example). I assume it’s because the input is “bad”.

    Your example is backwards – Suneido uses 8 bit character strings, so “Test” is (more or less) UTF-8 (= multi byte string = mbs).

    s = “Test”.Mbstowcs()
    => “T\x00e\x00s\x00t\x00\x00\x00”

    s.Wcstombs()
    => “Test”

  • Author
    Posts
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
Log In

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • Alpha copy of gSuneido to play with
  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo

Contact Us | Legal Statement | Privacy Statement | SiteMap

Copyright © 2023 Axon® Development Corporation. All Rights Reserved. - Open Source Integrated Database and Programming Language