Skip to content

Importing of itemInfo.lua with UTF-8 character encoding results in an error. #369

@ghost

Description

Environment

- PHP: 8.2
- MySQL: mariadb:11.0

Current Behavior

An error occurs when importing itemInfo.lua from the translation project.

Repository: https://github.com/llchrisll/ROenglishRE
File: https://github.com/llchrisll/ROenglishRE/blob/master/Pre-Renewal/System/itemInfo_EN.lua

It might have something to do with UTF-8 character set-

Originally my IDE wasn't setup correctly and it worked fine (UTF-8 charset seemed to have been discarded and replaced with random symbols).

Issue goes away when not using UTF-8 character encoding, but obviously I need to use UTF-8.

image

Once I fixed my IDE and ensured UTF-8 was correctly set up I started running into issues.

The issue appears when using the UTF-8 as seen below:

image

Most items still import just fine, but it seems that somewhere at the very end causes problems.

Any help on this would be greatly appreciated!

Error:

Critical Error
An error was encountered during the lifetime of the application.

This could be due to a variety of problems, such as a bug in the application.

However, normally it is caused by misconfiguration.

Exception Details
Error: PDOException

Message: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: '\xBE\xF3\xB1\xBC \xC7...' for column `midgard`.`cp_itemdesc`.`itemdesc` at row 1

File: /sites/example.com/lib/Flux/Connection/Statement.php:50

File	Line	Function/Method
/sites/example.com/lib/Flux/Connection/Statement.php	50	PDOStatement::execute()
/sites/example.com/modules/item/iteminfo.php	95	Flux_Connection_Statement::execute()
/sites/example.com/lib/Flux/Template.php	375	include()
/sites/example.com/lib/Flux/Dispatcher.php	170	Flux_Template::render()
/sites/example.com/index.php	154	Flux_Dispatcher::dispatch()
Exception Trace As String
#0 /sites/example.com/lib/Flux/Connection/Statement.php(50): PDOStatement->execute()
#1 /sites/example.com/modules/item/iteminfo.php(95): Flux_Connection_Statement->execute()
#2 /sites/example.com/lib/Flux/Template.php(375): include('...')
#3 /sites/example.com/lib/Flux/Dispatcher.php(170): Flux_Template->render()
#4 /sites/example.com/index.php(154): Flux_Dispatcher->dispatch()
#5 {main}

Expected Behavior

Import of itemInfo.lua should be free of any errors.

Steps To Reproduce

  1. Download the file at https://github.com/llchrisll/ROenglishRE/blob/master/Pre-Renewal/System/itemInfo_EN.lua
  2. Ensure UTF-8 characters are present in the file. Viewing raw in the browser doesn't seem to support UTF-8. If you download it in this format it will work fine, but the reality is we need it to work with UTF-8.
  3. Import into FluxCP via the import button in the control panel.

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions