exposing procs (#11218)

This commit is contained in:
Benny Elgazar
2019-05-11 11:32:34 +03:00
committed by Andreas Rumpf
parent b92fd30282
commit a83d609960

View File

@@ -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