Unicode support

Open
#206 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 11 days

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
aws, javascript, node.js
Domain
backend

Research direction

Reproduce with the provided importTest handler calling fileHandler.get(event, context) and a public/index.html containing ⏲️, confirming it returns ⏲️. In the serverless-aws-static-file-handler code, trace the StaticFileHandler.get path, especially where file contents are read and response headers/body are encoded. First inspect the HTML-serving branch and any charset handling, then run the same call after changes and verify the emoji is preserved.

Written by the indexing model from the issue text.

Description

bug good first issue help wanted
Expected behavior:

Can place UTF8 characters such as ⏲️ in a .html file and they render as-is after output

Actual behavior:

⏲️

Steps to reproduce the problem:
import StaticFileHandler from 'serverless-aws-static-file-handler';

import { dirname,join as pathjoin} from 'path';
import { fileURLToPath } from 'url';

const __dirname = dirname(fileURLToPath(import.meta.url));

const clientFilesPath = pathjoin(__dirname,"./public/")
const fileHandler = new StaticFileHandler(clientFilesPath);

export async function importTest(event,context){
	return fileHandler.get(event, context);
}

where public/index.html is as above

Environment:

serverless-aws-static-file-handler 4.0.2
node 18.12.1, framework 3.25.1 (local) 3.25.1v (global), plugin 6.2.2, SDK 4.3.2
Ubuntu 22.04 LTS

Dominant language
JavaScript
Stars
51
Forks
15
Avg merge
10d 13m
Merged PRs (30d)
1

Getting set up

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.

More from activescott/serverless-aws-static-file-handler

All issues in activescott/serverless-aws-static-file-handler

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.