catalog-import plugin does not support Unicode characters in catalog-info.yaml file
See original GitHub issueExpected Behavior
Importing a GitHub repo should allow Unicode characters in the submitted catalog-info.yaml file. For example, a file like this should work:
apiVersion: backstage.io/v1alpha1
kind: Component
metadata:
name: test-service
description: Description with emojis 🤖
spec:
lifecycle: production
type: service
owner: test-team
Current Behavior
Right now if you try to import the file above, you will get the following error: Failed to submit PR to repo, Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.
Possible Solution
Use a library like js-base64 to encode the file contents, which allows for Unicode characters.
Steps to Reproduce
- Create a custom LocationAnalyzer
- Modify the generated Entity in the custom LocationAnalyzer by adding a description field with Unicode characters in it
- Use custom LocationAnalyzer
- Try to import GitHub repository via
/catalog-import
Context
We are trying to add some extra information to the generated catalog-info.yaml file. This reduces the work for developers as they can import the file and not make any modifications afterwards. We fetch the description from GitHub and add it to the generated catalog-info.yaml file. Some of our repos have emojis in them, so creating the PR fails due to the lack of Unicode support in the native btoa function.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:21 (11 by maintainers)

Top Related StackOverflow Question
I am happy to wait, I can be working on the issue quietly in the background and implement once #4271 is merged
Should be fixed with #5146, thanks @padraigobrien.