openresty / openresty/luajit2

Processing Utf-16

Open
#44 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.4k
Forks
252
Avg merge
7d 11h
Merged PRs (30d)
3

Description

Hello
How print strings , that are in utf-16 encode
for example \U041C\U043E\U0441\U043A\U0432\U0430
I use this lib https://github.com/bungle/lua-resty-unistring
and this is my code

local us = require "unistring"
local sprintf = string.format
sprintf( ISSUER: %s ,
      us.str.u16_to_u8("\041C\043E\0441\043A\0432\0430"))

And I get error
unistring/str.lua:65: declaration specifier expected near ')
How to resolve it?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the call to us.str.u16_to_u8 in the provided Lua snippet and inspect unistring/str.lua at line 65. Confirm whether the UTF-16 input and error can be handled as shown; done means identifying a reproducible resolution for printing the supplied Cyrillic string.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
internationalization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.