Po redaktohet
Moduli:string/char
Kërceni tek navigimi
Kërceni tek kërkimi
Kujdes:
S’jeni i regjistruar. Adresa juaj IP do të jetë e dukshme publikisht, nëse bëni ndonjë redaktim. Nëse
hyni
ose
krijoni një llogari
, përveç përfitimesh të tjera, redaktimet tuaja do t’i atribuohen emrit tuaj të përdoruesit.
Kontrolli anti-spam.
Mos
e plotëso këtë!
local math_module = "Module:math" local char = string.char local error = error local format = string.format local pcall = pcall local select = select local tonumber = tonumber local type = type local function to_hex(...) to_hex = require(math_module).to_hex return to_hex(...) end local function codepoint_err(cp, i) -- Throw error: to_hex can only return integers, so only show the bad value -- if it can be converted into something that looks like a codepoint. local success, result = pcall(to_hex, cp, true) error(format( "bad argument #%d to 'string/char' (codepoint between 0x0 and 0x10FFFF expected%s)", i, success and "; got " .. result or ""), i + 3) end local function utf8_char(n, i, v, ...) local cp = tonumber(v) if cp == nil then error(format("bad argument #%d to 'char' (number expected; got %s)", i, type(v)), i + 2) elseif cp < 0 then codepoint_err(cp, i) elseif cp < 0x80 then if i == n then return cp end return cp, utf8_char(n, i + 1, ...) elseif cp < 0x800 then if i == n then return 0xC0 + cp / 0x40, 0x80 + cp % 0x40 end return 0xC0 + cp / 0x40, 0x80 + cp % 0x40, utf8_char(n, i + 1, ...) elseif cp < 0x10000 then -- Don't return "?" for surrogates, like mw.ustring.char does, as they -- have legitimate uses (e.g. in JSON). if i == n then return 0xE0 + cp / 0x1000, 0x80 + cp / 0x40 % 0x40, 0x80 + cp % 0x40 end return 0xE0 + cp / 0x1000, 0x80 + cp / 0x40 % 0x40, 0x80 + cp % 0x40, utf8_char(n, i + 1, ...) elseif cp < 0x110000 then if i == n then return 0xF0 + cp / 0x40000, 0x80 + cp / 0x1000 % 0x40, 0x80 + cp / 0x40 % 0x40, 0x80 + cp % 0x40 end return 0xF0 + cp / 0x40000, 0x80 + cp / 0x1000 % 0x40, 0x80 + cp / 0x40 % 0x40, 0x80 + cp % 0x40, utf8_char(n, i + 1, ...) end codepoint_err(cp, i) end return function(...) local n = select("#", ...) if n ~= 0 then return char(utf8_char(n, 1, ...)) end end
Përmbledhje:
Ju lutemi, vini re! Të gjitha kontributet në Enciklopedi Puro Shqiptare jepen për publikim sipas Creative Commons Attribution (shiko
Project:Të drejtat e autorit
për më shumë detaje). Nëse ju nuk dëshironi që shkrimet tuaja të redaktohen pa mëshirë dhe të shpërndahen sipas dëshirës, atëherë mos i vendosni këtu.
Gjithashtu, ju po na premtoni ne që gjithçka e keni shkruar vetë, ose e keni kopjuar nga një domain publik ose nga burime të tjera te hapura.
Mos vendosni material të mbrojtur nga e drejta e autorit pa leje!
Anuloje
Ndihmë për redaktim
(hapet në një dritare të re)
Stamp të përdorura në këtë faqe:
Moduli:string/char/doc
(
redakto
)
Menu lëvizjesh
Mjetet e mia
Nuk keni hyrë brenda
Diskutimi
Kontribute
Krijo llogari
Hyni
Emërhapësira
Moduli
Diskutim
English
Shikime
Lexo
Përpunoni burim
Shihni historikun
Më shumë
Kërko
Lëvizje
Faqja kryesore
Ndryshimet e fundit
Faqe e rastit
Ndihmë rreth MediaWiki-t
Faqet e veçanta
Mjete
Lidhjet këtu
Ndryshime të ndërvarura
Informacioni i faqes