rejetto forum

Is utf-8 encoding supported? Chinese, Korean, Czech characters?

newbie · 8 · 4738

0 Members and 1 Guest are viewing this topic.

Offline newbie

  • Occasional poster
  • *
    • Posts: 39
    • View Profile
Hi,
I am trying to create/view files and folders with utf-8 encoding. For e.g:
if I send the following curl cmd mkdir fails:
Quote
curl.exe -v -u user:password "http://localhost:280/data/Battlespaces/?mode=section&id=ajax.mkdir" --data "name=안녕"

As per this https://www.rejetto.com/wiki/index.php/HFS:_Template
Unicode support requires the following line in the tpl. It does in mine.
Quote
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />

When I added a print-to-log line in the tpl in the mkdir script:
Quote
[ajax.mkdir|no log]
{.check session.}
{.set|x|{.postvar|name.}.}
{.add to log|"Test:{.^x.}".}
{.break|if={.pos|\|var=x.}{.pos|/|var=x.}|result=forbidden.}
{.break|if={.not|{.can mkdir.}.}|result=not authorized.}
{.set|x|{.force ansi|%folder%{.^x.}.}.}

It prints
Quote
Test:??

Also, doesnt the force ansi operation break utf-8 encoding?

Am I missing some other configuration setting?

Thanks
« Last Edit: March 02, 2021, 08:17:23 PM by newbie »



Offline danny

  • Tireless poster
  • ****
    • Posts: 281
    • View Profile
<style>body{font-family:"Arial Unicode MS","Lucida Sans Unicode","DejaVu Sans",sans-serif}</style>
It tells the client's browser to use windows, mac, linux, unicode fonts. 


Offline newbie

  • Occasional poster
  • *
    • Posts: 39
    • View Profile
Thanks for your responses DJ and Danny.

- Tried hfs2.4beta (2.4.0 RC6). Didnt make a difference.
- Also tried adding that style to the tpl. It too didnt make a difference.

In both 2.3m and 2.4.0 RC6, if I use the webUI's NewFolder button and copy/paste enter "안녕" in there, the response is that it Failed.
The logs print out my print statement like my original comment, printing:
Test:??


Offline newbie

  • Occasional poster
  • *
    • Posts: 39
    • View Profile
No....wait. I was wrong.
If I use my existing tpl HFS for some reason opened HFS with version:2.3m and it fails.
If I delete my tpl and restart HFS without it, the UI looks different and Korean characters are working.

So, this looks its working. I'll continue working w/ it, and come back w/ questions if I find anything odd.

Thanks all.


Offline newbie

  • Occasional poster
  • *
    • Posts: 39
    • View Profile
So creating a new folder from the webUI with Korean characters works just fine. And HFS even displays an existing folder w/ Korean chars.

However, when I try to create a folder using curl, it fails.
I tried:
Quote
curl.exe -v -u user:password "http://localhost:280/data/Battlespaces/?mode=section&id=ajax.mkdir" --data "name=안녕22"
Quote
curl.exe -v -u user:password "http://localhost:280/data/Battlespaces/?mode=section&id=ajax.mkdir" --data "name=안녕22" -H "Content-type: text/plain; charset=utf-8"

I printed out the value got from postvar|name in mkdir
Quote
[ajax.mkdir|no log]
{.check session.}
{.set|x|{.postvar|name.}.}
{.add to log|"Test:{.^x.}".}

For curl#1: The log prints "Test:??22"
For curl#2: The log prints "Test:"

I need similar support for curl for rename, deletion etc.

Does anyone have any suggestions?

Thank you in advance.


Offline dj

  • Tireless poster
  • ****
    • Posts: 291
  • 👣 🐾
    • View Profile
    • PWAs
it seems a problem of curl
searching in google I find:
https://experienceleaguecommunities.adobe.com/t5/adobe-experience-manager/curl-command-issue-with-special-characters/qaq-p/259276
untested

-H "Content-Type: application/x-www-form-urlencoded; charset=utf-8"
« Last Edit: March 04, 2021, 04:02:28 AM by dj »


Offline newbie

  • Occasional poster
  • *
    • Posts: 39
    • View Profile
Curl cmds I've tried (and failed to get it to work)
Quote
curl.exe -v -u user:password "http://localhost:280/data/Blah/?mode=section&id=ajax.mkdir" --data "name=안녕22"
Quote
curl.exe -v -u user:password "http://localhost:280/data/Blah/?mode=section&id=ajax.mkdir" --data "name=안녕22" -H "Content-type: text/plain; charset=utf-8"
Quote
curl.exe -v -u user:password "http://localhost:280/data/Blah/?mode=section&id=ajax.mkdir" --data "name=안녕22" -H "Content-type: application/x-www-form-urlencoded; charset=utf-8"
Quote
curl.exe -v -u user:password "http://localhost:280/data/Blah/?mode=section&id=ajax.mkdir" --data-urlencode "name=안녕22" -H "Content-type: application/x-www-form-urlencoded; charset=utf-8"

I found that curl supports a trace option (--trace -) and I tried that
Quote
curl.exe -v -u user:password "http://localhost:280/data/Blah/?mode=section&id=ajax.mkdir" --data "name=안녕22" -H "Content-type: application/x-www-form-urlencoded; charset=utf-8" --trace -
And it does appear to be a curl issue. The data sent to HFS is bogus. See attached pic.