mirror of
https://github.com/apple/pkl.git
synced 2026-05-28 09:39:17 +02:00
Fix handling of file: module URIs with non-ASCII characters (#696)
Addresses an issue where Pkl cannot evaluate files with non-ASCII characters.
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
// covers https://github.com/apple/pkl/issues/653
|
||||
日本語 = "Japanese language"
|
||||
readOne = read("日本語.pkl").text
|
||||
readGlob = read*("./日*.pkl").keys
|
||||
importOne = import("日本語.pkl").readOne
|
||||
importGlob = import*("./日*.pkl").keys
|
||||
@@ -0,0 +1,2 @@
|
||||
// covers https://github.com/apple/pkl/issues/653
|
||||
日本語 = throw("Error reporting should also handle unicode filenames!")
|
||||
@@ -0,0 +1,21 @@
|
||||
日本語 = "Japanese language"
|
||||
readOne = """
|
||||
// covers https://github.com/apple/pkl/issues/653
|
||||
日本語 = "Japanese language"
|
||||
readOne = read("日本語.pkl").text
|
||||
readGlob = read*("./日*.pkl").keys
|
||||
importOne = import("日本語.pkl").readOne
|
||||
importGlob = import*("./日*.pkl").keys
|
||||
|
||||
"""
|
||||
readGlob = Set("./日本語.pkl", "./日本語_error.pkl")
|
||||
importOne = """
|
||||
// covers https://github.com/apple/pkl/issues/653
|
||||
日本語 = "Japanese language"
|
||||
readOne = read("日本語.pkl").text
|
||||
readGlob = read*("./日*.pkl").keys
|
||||
importOne = import("日本語.pkl").readOne
|
||||
importGlob = import*("./日*.pkl").keys
|
||||
|
||||
"""
|
||||
importGlob = Set("./日本語.pkl", "./日本語_error.pkl")
|
||||
@@ -0,0 +1,10 @@
|
||||
–– Pkl Error ––
|
||||
Error reporting should also handle unicode filenames!
|
||||
|
||||
x | 日本語 = throw("Error reporting should also handle unicode filenames!")
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at 日本語_error#日本語 (file:///$snippetsDir/input/modules/%E6%97%A5%E6%9C%AC%E8%AA%9E_error.pkl)
|
||||
|
||||
xxx | text = renderer.renderDocument(value)
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
at pkl.base#Module.output.text (pkl:base)
|
||||
Reference in New Issue
Block a user