ErikOnBike/CodeParadise

problem with international characters

janbkrejci opened this issue · 7 comments

Hi, when I add an international character into CpCounterView class>>template, i.e. "š", I get an error: "CpClientDecodeFailed: 'Error: Subscript is out of bounds: 43'". Any idea? Thanks. (And congrats for this wonderful code!)

Hi Jan. Thanks for reporting this issue.

Found the cause of the issue. The Pharo Candle implementation (which forms the basis for my tiny Smalltalk image) only implemented ByteString and not WideString (how did I miss this before?!). International characters require WideStrings. This requires a little more work to fix. So please stay tuned.

Short update: been working on this issue, but regular job required most of my time. So progress is slow, but getting there ;-).

Great, thanks, Erik. I am afraid you will find that squeakjs itself has some difficulties with unicode chars - even JS alert: 'unicode char' throws an error, and with Squeak or Pharo image I was not able to type unicode chars in Workspace{Playground... Unfortunately it is far beyond my humble capabilities to pinpoint the root cause better... Best regards, Jan

Jan! I think I've managed to implement WideString support with full Unicode support. I'm able to render Strings containing international characters as well as Unicode emojis. Could you give it a go and let me know if this works for you? Don't forget to pull both CodeParadise and CP-ClientEnvironment. If you haven't stayed up to date, consider using the CP-ClientEnvironment from Pharo. It allows you to keep track of changes in a single place. @macta added this and also added a menu item for easy starting and stopping of applications. HTH

Loading CP-ClientEnvironment from Pharo:

Metacello new
  repository: 'github://ErikOnBike/CP-ClientEnvironment';
  baseline: 'CpClientEnvironment';
  load.

Thanks, Erik,

looks good - I am now able to use czech unicode characters in Counter

Snímek obrazovky 2021-04-13 v 18 50 11

Nice! I'll close this issue then. If something pops up. Just open a new issue.