exposing procs (#11218)
This commit is contained in:
parent
b92fd30282
commit
a83d609960
1 changed files with 2 additions and 2 deletions
|
|
@ -217,14 +217,14 @@ when defined(windows):
|
|||
proc getCPInfo(codePage: CodePage, lpCPInfo: var CpInfo): int32 {.
|
||||
stdcall, importc: "GetCPInfo", dynlib: "kernel32".}
|
||||
|
||||
proc nameToCodePage(name: string): CodePage =
|
||||
proc nameToCodePage*(name: string): CodePage =
|
||||
var nameAsInt: int
|
||||
if parseInt(name, nameAsInt) == 0: nameAsInt = -1
|
||||
for no, na in items(winEncodings):
|
||||
if no == nameAsInt or eqEncodingNames(na, name): return CodePage(no)
|
||||
result = CodePage(-1)
|
||||
|
||||
proc codePageToName(c: CodePage): string =
|
||||
proc codePageToName*(c: CodePage): string =
|
||||
for no, na in items(winEncodings):
|
||||
if no == int(c):
|
||||
return if na.len != 0: na else: $no
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue